Hi,
I have a problem with my application where actionServlet becomes null in
UNIX environment and works fine in windows XP system. While saving data on
test environment (UNIX) I am getting action servlet as null in My Action
class. The jsp is built dynamically in as below
*JSP code:*
if (newGuide) {
sb.append("<tr>\n");
sb.append("<td align=right colspan=2>\n");
sb.append("<select name=\"actionSelection\">");
sb.append(" <option value=saveOnly>- Save Assessment</option>");
sb.append(" <option value=delete>- Delete Assessment</option>");
sb.append(" <option value=saveSchedule>- Save & Schedule</option>");
sb.append(" <option value=saveRefer>- Save & Refer</option>");
sb.append("</select>");
sb.append(" <input type=\"submit\" name=\"save\"
value=\"Complete\" class=Button >");
sb.append("</td>\n");
sb.append("</tr>\n");
}
* Action Class // Action class used for security *
public void setServlet(ActionServlet actionServlet) {
super.setServlet(actionServlet); // Here I get actionServlet as null
ServletContext servletContext = actionServlet.getServletContext();
WebApplicationContext wac = WebApplicationContextUtils
.getRequiredWebApplicationContext(servletContext);
setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso
r"));
}
Because of this I get null pointer exception in class Main Action Class used
for saving the data.
*Action class code :*
public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
String method = "saveHAGuide";
Exception ex = null;
ActionForward forward = null;
AppUser appUser = getAppUser(request);
appUser.methodStart(this, "saveHAGuide");
HttpSession session = request.getSession(false);
String action = request.getParameter("actionSelection"); // Here I get
action as null
Action becomes null and it throws null pointer exception.
As UNIX is case sensitive I checked the request parameter which is
actionSelection in this class and I do not see any problem with it. I don't
know why action servlet becomes null at this point. Please suggest if you
have any idea about this.
Note: This happens only in test environment (UNIX). Works fine in my local
system (Windows XP) .
Thanks and regards,