File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes request becomes null in unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "request becomes null in unix" Watch "request becomes null in unix" New topic

request becomes null in unix

Dips Rawat

Joined: Feb 02, 2009
Posts: 1
Hi all,
I have a problem with my application where request becomes null in
UNIX environment and works fine in windows XP system.
When I select a value from dropdown and hit submit eg. i selected Save. It fails to save as selected value comes null.
The selected value is null always.

JSP code which is built dynamically in a java class is as below:

if (new) {
sb.append("<td align=right colspan=2>\n");
sb.append("<select name=\"actionSelection\">");
sb.append(" <option value=\"save\">- Save </option>");
sb.append(" <option value=\"delete\" >- Delete </option>");
sb.append(" <option value=\"saveSchedule\" >- Schedule</option>");
sb.append(" <option value=\"saveRefer\" >- Refer</option>");
sb.append("</select>"); sb.append(" <input type=\"submit\" name=\"save\"
value=\"Complete\" class=Button >");

Action class code :
public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
String method = "save";
Exception ex = null;
ActionForward forward = null;
AppUser appUser = getAppUser(request);
appUser.methodStart(this, "save");
HttpSession session = request.getSession(false);
String action = request.getParameter("actionSelection"); // Here I get action as null

action value comes as 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
anyone has any idea about this.Please let me know if you need some more information . I appreciate any help.
Note: This happens only in UNIX environment. Works fine in my local system (Windows XP).

Thanks ,
David Newton

Joined: Sep 29, 2008
Posts: 12617

Neither the request nor action servlet is null as you state: the request parameter is null.

Have you verified that the request is being GET/POSTed with the correct parameters (checking via Firebug or similar)?
I agree. Here's the link:
subject: request becomes null in unix
It's not a secret anymore!