Just have a few questions regarding Java Servlets:
1) What happens when a browser requests a servlet for the first time?
2) Is the the response.setContentType(text,html) the first instruction sent to the browser?
Have been searching the web for answers but not quite sure.
Thanks
No, the first thing to send is the HTTP version 🙂
The last line before the content is the content type you are talking about. These headers may occur in different order and there are usually more of them. They order is not strictly defined, maybe the content type would occur before the date. However the HTTP version number and response code (200 – OK in my example) always come first. Read more about HTTP fields here.