This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "request becomes null in unix" Watch "request becomes null in unix" New topic
Author

request becomes null in unix

Dips Rawat
Greenhorn

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("<tr>\n");
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 >");
sb.append("</td>\n");
sb.append("</tr>\n");
}

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
Author
Rancher

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: http://aspose.com/file-tools
 
subject: request becomes null in unix
 
Similar Threads
"The path of an ForwardConfig cannot be null" error in Second run
Storing resultset into arraylist
exception
http 500 in jsp page
http 500 in jsp page