Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this one HttpRequest cycle ?

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic