Example #1
0
 @Action(
     value = "department.cutSalariesOfDepartment",
     results = {@Result(name = "detail", location = "department-detail.jsp")})
 public String cutSalariesOfSubunit() throws Exception {
   department = CompanyService.instance().findDepartment(department.getId());
   department.cut();
   return "detail";
 }
Example #2
0
 @Action(
     value = "department.detail",
     results = {@Result(name = "detail", location = "department-detail.jsp")})
 public String execute() {
   // the next assignment exposes the department
   // member as a "bean", so that the forwarded view (a JSP)
   // component is able to access its value.
   department =
       CompanyService.instance()
           .findDepartment(Long.parseLong(RequestUtil.getRequestParameter("dptId")));
   return "detail";
 }
Example #3
0
  @Action(
      value = "department.update",
      results = {@Result(name = "detail", location = "department-detail.jsp")})
  public String update() {
    // ok, it might sound a bit redundant, but if we change the
    // persistence mechanism to a database, all these
    // lines would be necessary.

    Department old = CompanyService.instance().findDepartment(department.getId());

    old.setName(department.getName());
    old.setManager(department.getManager());

    department = old;
    message = "The department data was updated.";
    return "detail";
  }