File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Request parameters are lost in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Request parameters are lost in jsp" Watch "Request parameters are lost in jsp" New topic
Author

Request parameters are lost in jsp

Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11
Hi,

In JSP all the request parameters values are lost. But this application works fine in weblogic but in jboss i have an issue. Please let me know do i need to do any specific configuration in jboss. I am using jboss.5.0.1


All the request parameters which are sent in the application are lost.

Regards
Sudhakar
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Sounds like you have incorporated WLS-specific features in your web app. Remove them and it should work fine.

(If you want more specific help, TellTheDetails)


JBoss In Action
Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11

I am not using any wlm specific features. Its plain jsp and servelets.

WebActionMapping webActionMapping = this.getWebActionMapping(selectedURL);
actionHandler = this.getWebActionHandler(webActionMapping, webSM);
actionHandler.init(_request,_response,webSM,webActionMapping);

// call action method to handle the request
String actionMethodName = webActionMapping.getWebActionMethodName();
Method actionMethod = this.getActionMethod(actionHandler,actionMethodName);
logger.log(Level.INFO,"Invoke " + webActionMapping.getWebActionHandlerClass() + "." + actionMethodName + "()");
actionMethod.invoke(actionHandler,new Object[0]);
nextScreen = actionHandler.getNextScreen();
redirect = actionHandler.isRedirect();

// place the web session manager proxy in session for JSP
if (!webSM.isDestroyed())
this.setWebSessionManagerProxy(webSM);
}
String forwardURL = nextScreen;
if (redirect)
{ System.out.println("If redirect is true");
logger.log(Level.INFO,"Redirecting request to [" + contextURL + forwardURL + "]");
// redirecting url needs to be relative to the server root path
_response.sendRedirect(_response.encodeRedirectURL(contextURL + forwardURL));
} else {
System.out.println("If forwardURL is true");
// forwading url are relative to the webapp context path
forwardURL = "/" + forwardURL;
logger.log(Level.INFO,"Forwarding request to [" + forwardURL + "]");
RequestDispatcher rd = context.getRequestDispatcher(_response.encodeURL(forwardURL));
// up to here i am getting values from request, But in jsp i am getting null
rd.forward(_request, _response);
}
Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11
More details

I am using frameset.

I have one main jsp which includes the other jsp. In the main jsp i am getting therquest values, But other included jsp like AAA.jsp i am not getting the request values
function refreshFrame() {
frames['adminMngAnalystTop'].window.location.href = "AAA.jsp";
frames['adminMngAnalystMiddle'].window.location.href = "BBB.jsp";
}
</script>
</head>
<frameset rows="200px,300px,40px" border ="0" noresize="noresize" onFocus="checkIssrSearchModal();">
<frame src="AAA.jsp" name="AA" noresize="noresize scrolling="no"/>
<frameset cols="45%,10%,45%" border="1" noresize="noresize">
<frame src="BB.jsp" name="BB" frameborder="1" scrolling="yes" />
</frameset>
</frameset>
</html>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Reddy Sudhakar wrote:I have one main jsp which includes the other jsp. In the main jsp i am getting therquest values, But other included jsp like AAA.jsp i am not getting the request values

Of course not. They're entirely different pages generated by a different request/response.

By the way, red text on a brown background is practically unreadable. I'd revisit any decision to use such colors when posting.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11
Same code is working in weblogic, why not jboss?
Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11
One more observation

If i include jsp using <%@ include file="header.jsp" %> tab, I am getting the request parameters
But if i use frames sets , i am not getting the request parameters.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Reddy Sudhakar wrote:
If i include jsp using <%@ include file="header.jsp" %> tab, I am getting the request parameters
But if i use frames sets , i am not getting the request parameters.

Of course. With include there is one page, and one request/response.

With frame sets (which sort of when out of favor in 1999) there are multiple separate pages and requests/responses.
Reddy Sudhakar
Greenhorn

Joined: Sep 23, 2002
Posts: 11
how come same code work in weblogic. is there any speecific configuration required in jboss?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Unless weblogic is broken, or there's much more to the story than you are telling us, it cannot be "working". Request parameters sent to one request cannot (or should not) leak over into unrelated requests.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request parameters are lost in jsp
 
Similar Threads
Redirecting from JSP to CGI
Request Mapping in servlet for MVC
Help - performance issue in web-app using caching.
Send redirect
redirecting the request to URL