File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Is this one HttpRequest cycle ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is this one HttpRequest cycle ?" Watch "Is this one HttpRequest cycle ?" New topic
Author

Is this one HttpRequest cycle ?

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
In "main.jsp" there are some radio button, checkbox, etc, when you click "submit", it calls "SubmitAction" action class and forward back to "main.jsp" again.

So it is like: main.jsp--->submitAction.do-->main.jsp From the "1st" main.jsp to the "2nd" main.jsp, is it ONE HttpRequest cycle ? The rason why I ask this is --

After user click submit" the main.jsp will be reloaded but with newly processed information.. I want to use "request.getParamter("...")" in my main.jsp to retrieve what users picks for the first time on main.jsp before he clicks "submit". I know I can just try, but I want to make sure conceptually it is one HttpRequest cycle or not.

Thanks.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
When the user types the URL ..../main.jsp and the JSP tags are interpreted and rendered into HTML, that's one request. When the user clicks the submit button, that causes the browser to send another request to the server. Your SubmitAction class reads that request and then forwards to main.jsp, which has access to that request object as it's rendering the HTML to be sent back to the browser.

So, from the time the user first types in the URL to the page being displayed a second time, there are two requests. From the time the user presses the submit button until the page is redisplays, there is one request.

Does that make sense? I hope I haven't added more confusion.


Merrill
Consultant, Sima Solutions
Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this one HttpRequest cycle ?
 
Similar Threads
Selective frame refresh
doing database updates in struts
Browser back button
mock question
Communication between browsers