package dk.hansen; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; public final class DetailDVDForm extends ActionForm { /* Id */ private String id = null; public String getId() { return (this.id); } public void setId(String id) { this.id = id; } /* Title */ private String title = null; public String getTitle() { return (this.title); } public void setTitle(String title) { this.title = title; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // Log the forms data servlet.log("Id:" + id); servlet.log("Title:" + title); // Check if properties are present ActionErrors errors = new ActionErrors(); if (id == null || id.equals("")) { errors.add("id", new ActionError("error.id.missing")); } if (title == null || title.equals("")) { errors.add("title", new ActionError("error.title.missing")); } return errors; } }