Every time I call "ValidateEmployee.do" in my inputContent.jsp it directs me to a blank white page on ie with this URL:
http://localhost:8080/begjsp-ch18/validateEmployee.do;jsessionid=32... It should either go to the outputContent.jsp or revert back to inputContent.jsp containing the errors from MessageResources.properties. ActionServlet obviously found the mapping so I'm not sure what it could possibly be. I am using
Tomcat v5 on windows os with the latest version of jakarata
struts. Here is some of my information not that it would be of any help:
web.xml
<!-- Standard Action
Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
struts-config.xml
<action path="/validateEmployee"
type="com.example.ValidateEmployeeAction"
name="empForm"
scope="request"
input="/inputContent.jsp"
validate="false">
<forward name="success" path="/outputContent.jsp"/>
</action>
ValidateEmployeeAction.java
public class ValidateEmployeeAction extends Action {
public ActionForward perform(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException {
ActionMessages errors = new ActionMessages();
EmployeeForm empForm = (EmployeeForm)form;
String name = empForm.getName();
if(name.trim().equals("")) {
ActionMessage error = new ActionMessage ("error.missing.name");
errors.add("ActionMessages.GLOBAL_MESSAGE",error);
}
String department = empForm.getDepartment();
if(department.trim().equals("")) {
ActionMessage error = new ActionMessage("error.missing.department");
errors.add("ActionMessages.GLOBAL_MESSAGE",error);
}
String[] skills = empForm.getSkills();
if(skills == null) {
ActionMessage error = new ActionMessage("error.missing.skills");
errors.add("ActionMessages.GLOBAL_MESSAGE",error);
}
if(errors.size() > 0) {
saveErrors(request,errors);
return (new ActionForward(mapping.getInput()));
}
return (mapping.findForward("success"));
}
}