Professional Documents
Culture Documents
Functions of servlet:
-Generate results
//Use request to read incoming http headers (cookies) and query data from html form
1.Tell the browser that you’re sending it HTML. –This can be accomplished by setting Http Content-Type
i.e response.setContentType(“text/html”)
Set response headers before actually returning any of the content with the PrintWriter because http
response consists of headers.
You must set the content type before transmitting the actual document.
<!DOCTYPE ...>----------------This tag is used to know which html version is being used