This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Is this one HttpRequest cycle ?  RSS feed

 
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.
 
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.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!