Re: html servlet flow



"Jeff Kish" <kishjjrjj@xxxxxxxxxxx> wrote in message news:k4r692pmjoogfsdos562aqa7nuempqeat8@xxxxxxxxxx

Is this right?

The general gist of it looks right. As for the details, I'm not sure. I've never actually done JSP programming, nor used Tomcat.


Say there is a hard coded jsp page, say:
mypage.jsp in the right dir under tomcat,
if the user types in the browswer address bar:
http://tomcat/jmypage.jsp

and presses return, then...

Then the browser packs up the 'mypage.jsp' and
formats it in the protocol of http, and send it to
the address (tomcat here).

Probably browser sends '/jmypage.jsp'. The 'j' is probably a typo, but the slash is important. A browsers' request is always an absolute path, AFAIK.


Then tomcat recognizes the protocol, unpacks the
request, and sees "mypage.jsp".
Then it looks wherever it is legal for jsp pages to exist,
and starts processing the mypage.jsp?

This is *probably* what Tomcat does, but webservers are free to not actually look for a physical file, but instead generate a response in some other fashion. Imagine for example, that the browser requests for the url '/random', and the webserver recognizes this as a special address which doesn't actually point to a file, but instead indicates that the server should generate a random 32-bit integer and send its decimal string representation as a response. None of this would be violating the HTTP protocol AFAIK.

Most webservers simply look for files matching the provided name, as you've said though.


If it is a simple page, it packs up the code/html in the jsp page into
the response and puts it in http format and sends it to the browser.

Right, but a minor terminology nitpick here: HTTP is not a format, but a protocol. Traditionally, no transformation is done to the data. The server sends a message to the browser, whose header says "This is an text/html file. It's length is 320 bytes." and then immediate starts sending the data as-is.

More recent servers might negotiate compression schemes. I'm not sure exactly how it works, but I imagine it's something like when the browser requests the page, it'll say "GET me /mypage.jsp. Oh and by the way, if you can gzip it, that'll be lovely." And the server will generate the response (perhaps by reading the %WEBROOT%/mypage.jsp file), and if it knows how, it'll gzip it. If it doesn't know how, it just sends the content as is.


When the browser gets the response, it recognizes it is http, unpacks
it, and starts processing the html in the response.

The browser doesn't have to do any recongition at this point. It all happens under one connection. At the IP level, the browser connects to the server, and does its GET request. The server processes this, sends back its response, and closes the connection.


And this 'response' isn't the response parameter in the doGet method,
it is just the general 'response' from the Tomcat.

Extra informatoin like headers etc are in the actual doget 'response'
variable.

I didn't understand these last two parts. They sound JSP/Tomcat specific.

- Oliver

.



Relevant Pages

  • Re: NotificationSampleWebDav-Monitor OWA Inbox
    ... re-login or update your cookie with each response you get... ... Warning: Exiting Action with an exception: The remote server returned an ... // Create request object and assign credentials. ... Stream newStream = Request.GetRequestStream; ...
    (microsoft.public.exchange.applications)
  • Re: Response.Flush: Differences between IIS 6.0 and 5.0?
    ... I do not expect my ASP script to continue running until the ... ASP did send the entire response buffer to the client prior to continuing ... 'See how long it takes to Flush to the browser ... Browsing to this ASP page hosted on an IIS 5.0 server yield the following ...
    (microsoft.public.inetserver.iis)
  • Re: BASIC authentication Issues with IE - Part II - Solved but WHY?
    ... We have complete control of the Request and Response ... it is up to the browser to send the credentials. ... ASP runs internally on the server. ...
    (microsoft.public.inetserver.iis.security)
  • Re: HTTP header processing sequence
    ... more about how the browser match up all the responses send from the server ... Initially it sends the request for the html ... So the association of request and response is no problem. ...
    (microsoft.public.win32.programmer.networks)
  • Re: client gets always every first time for every page a 401
    ... only the first request get 401. ... Why does my Browser in case 5 not submit the Basic Authorization String ... credentials as used in 3, because they have the same root. ... Explorer has established a connection with the server by using Basic or NTLM ...
    (microsoft.public.inetserver.iis.security)