Java Servlets and JSP Interview Questions and Answers - 3

Question: 11

What is session ID?

A session ID is an unique identification string usually a long, random and alpha numeric string, that is transmitted between the client and the server.

Session IDs are usually stored in the cookies, URLs ( in case url rewriting) and hidden fields of Web pages.

Question: 12

What are the different types of session tracking?

Mechanisms for session tracking are:

Cookies

URL rewriting

Hidden form fields and

SSL sessions

Question: 13

What is the difference between ServletContext and PageContext?

ServletContext: Gives the information about the container.

PageContext: Gives the information about the Request.

Question: 14

Can we implement an Interface in a JSP?

No

Question: 15

What is ServletContext?

ServletContext is an interface that defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests or writes to a log file.

There is one context per “web application” per Java Virtual Machine.

Related Questions