View Javadoc
1 /* 2 * Demosys. 3 * 4 * Terms of license - http://opensource.org/licenses/apachepl.php 5 */ 6 package org.demosys.task; 7 import org.apache.struts.action.ActionError; 8 import org.apache.struts.action.ActionErrors; 9 import org.apache.struts.action.ActionForm; 10 import org.apache.struts.action.ActionMapping; 11 /*** 12 * Formulaire pour la creation d'une task. 13 */ 14 public class ModificationTaskForm extends ActionForm { 15 private String title; 16 17 public void reset(ActionMapping actionMapping, 18 javax.servlet.http.HttpServletRequest httpServletRequest) { 19 setTitle(null); 20 } 21 22 23 public ActionErrors validate(ActionMapping actionMapping, 24 javax.servlet.http.HttpServletRequest httpServletRequest) { 25 ActionErrors errors = new ActionErrors(); 26 27 if (this.getTitle().length() < 2) { 28 errors.add("title", new ActionError("task.modification.error.title")); 29 } 30 31 return errors; 32 } 33 34 35 public String getTitle() { 36 return title; 37 } 38 39 40 public void setTitle(String title) { 41 this.title = title; 42 } 43 44 45 public TaskView toTaskView() { 46 TaskView task = new TaskView(); 47 task.setTitle(getTitle()); 48 49 return task; 50 } 51 }

This page was automatically generated by Maven