Discussions

Web tier: servlets, JSP, Web frameworks: regd refresh in browser

  1. regd refresh in browser (2 messages)

    Hi,
    I have a dbt how refresh works for servlets.
    I have a html page which asks user for color.When submitted control goes to below servlet which dispalys users color..Thts ok.

    http://localhost:9000/chapter01/DemoServlet2uri
     Ur color:entered color

    My dbt is, when i refereshed this url or clicked enter with same address on this browser's window addr bar, is a new request sent to the server ? or is the same old request ? bcas i think if a new request is sent then it shuld dispaly the color=null bcas this req doesnt have any user entered color val.
    If its the same old req then wht is the mechanism behind it?
    can anyone clear me this dbt or give me any link to study.

    Thnx
  2. regd refresh in browser[ Go to top ]

    Hi Mysha,

    Every time Browser requests some resource from a server, it generate a new request.i.e. it generate a stateless request.
    So refresh or clicking just Enter will also generate a fresh request
    We maintain the session between a browser and a server using session handling APIs.

    Rgds,
    Vilish
  3. your browser refresh sends the same request which is stored when you hit the browser go button first time..

    i.e it issues

    http://localhost:9000/chapter01/DemoServlet2uri
     Ur color:entered color