FileDocCategorySizeDatePackage
UpdateProfileAction.javaAPI DocExample1626Tue Jun 08 11:26:42 BST 2004com.mycompany.messages

UpdateProfileAction

public class UpdateProfileAction extends Object
This class updates a user profile in the Project Billboard application.
author
Hans Bergsten, Gefion Software
version
1.0

Fields Summary
private EmployeeRegistryBean
empReg
private EmployeeBean
validUser
private String[]
projects
private String
requestMethod
Constructors Summary
Methods Summary
public java.lang.String[]getProjects()

	return validUser.getProjects();
    
public EmployeeRegistryBeangetRegistry()

	return empReg;
    
public java.lang.StringgetRequestMethod()

	return requestMethod;
    
public EmployeeBeangetValidUser()

	return validUser;
    
public voidsetProjects(java.lang.String[] projects)

	this.projects = projects;
    
public voidsetRegistry(EmployeeRegistryBean empReg)

	this.empReg = empReg;
    
public voidsetRequestMethod(java.lang.String requestMethod)

	this.requestMethod = requestMethod;
    
public voidsetValidUser(EmployeeBean validUser)

	this.validUser = validUser;
    
public java.lang.StringupdateProfile()
Updates the projects property of an authenticated user, represented by the "validUser" session attribute, using the EmployeeRegistryBean. This action is only performed for POST requests.

        if ("POST".equals(requestMethod)) {
            if (projects == null) {
                projects = new String[0];
            }
            validUser.setProjects(projects);
	    empReg.saveEmployee(validUser);
        }
        return "success";