© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu

Home Placements Interview Questions Java Interview Questions And Answers Java Interview Questions On Servlets ▼

Java Interview Questions On Servlets

13. When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

Answer
know all major browsers ignore it even though the HTML 3.2 and 4.0 specifications require it. But building a DOCTYPE line tells HTML validators which version of HTML you are using so they know which specification to check your document against. These validators are valuable debugging services, helping you catch HTML syntax errors.
http://validator.w3.org and
http://www.htmlhelp.com/tools/validator/
are two major online validators.

14. What mechanisms are used by a Servlet Container to maintain session information?

Answer
Cookies, URL rewriting, and HTTPS protocol information are used to maintain session information

15. What is the Difference between GET and POST?

Answer
In GET, your entire form submission can be encapsulated in one URL, like a hyperlink. query length is limited to 260 characters, not secure, faster, quick and easy.

In POST, your name/value pairs inside the body of the HTTP request, which makes for a cleaner URL and imposes no size limitations on the form's output. It is used to send a chunk of data to the server to be processed, more versatile, most secure.

16. What is session?

Answer
The session is an object used by a servlet to track a user's interaction with a Web application across multiple HTTP requests

17. What is servlet mapping?

Answer
The servlet mapping defines an association between a URL pattern and a servlet. The mapping is used to map requests to servlets.

18. What is servlet context ?

Answer
The servlet context is an object that contains a servlet's view of the Web application within which the servlet is running. Using the context, a servlet can log events, obtain URL references to resources, and set and store attributes that other servlets in the context can use. (answer supplied by Sun's tutorial).

Previous Next
1 2 3 4 5
SLogix Student Projects
bottom