-2

I have this question, when some one clicks on submit button on a page assume this happens, two JSP requests go to the server.

  1. Would there be two htmls or just one html response by the server.
  2. If there is only one html response for Two JSP requests, how is this achieved?

Thanks

George G
  • 7,443
  • 12
  • 45
  • 59
  • Http works this way: when you send a request, you get back a response. It's as simple as that. So if you send 2 requests, you'll get back 2 responses. – JB Nizet Oct 04 '14 at 05:53
  • Why would clicking on a submit button trigger two HTTP requests? – Quentin Oct 04 '14 at 07:42

1 Answers1

0

Would there be two htmls or just one html response by the server response object will be created for each http request. so if you provide two requests , there will be two response objects in turn.

If you are considering in terms of view , there will be only one view returned . it can either through RequestDispatcher or sendRedirect.

See How do servlets work? Instantiation, sessions, shared variables and multithreading

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56