• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is this one HttpRequest cycle ?

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic