More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. Session tracking is a mechanism that servlets use to maintain state about a series requests from the same user across some period of time. The methods used for session tracking are:
User Authentication - occurs when a web server restricts access to some of its resources to only those clients that log in using a recognized username and password
Hidden form fields - fields are added to an HTML form that are not displayed in the client's browser. When the form containing the fields is submitted, the fields are sent back to the server
URL rewriting - every URL that the user clicks on is dynamically modified or rewritten to include extra information. The extra information can be in the form of extra path information, added parameters or some custom, server-specific URL change.
Cookies - a bit of information that is sent by a web server to a browser and which can later be read back from that browser.
HttpSession- places a limit on the number of sessions that can exist in memory.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  j2ee   servlets   session   session management   web applications   cookies   httpsession   url rewriting   architecture Asked in 1 Companies
Frequently asked. Among first few questions in the J2EE segment of interview.
Ans. Deployment Descriptor which is usually web.xml is used to specify the classes, resources and configuration of the application and how the web server uses them to serve web requests.This file is usually added to WEB-INF folder and contains following
* Servlet entries and url mapping
* Plugins
* Some info regarding authentication / filters
* Landing Page
* Event Handlers
Help us improve. Please let us know the company, where you were asked this question :
Ans. servlet is a small, server-resident program that typically runs automatically in response to user input. A network socket is an endpoint of an inter-process communication flow across a computer network.
We can think of it as a difference between door and gate. They are similar as they both are entry points but they are different as they are put up at different areas.
Sockets are for low-level network communication whereas Servlets are for implementing websites and web services
Help us improve. Please let us know the company, where you were asked this question :
Ans. The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet. This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file location.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page. This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Translation of JSP PageCompilation of JSP PageClassloading (class file is loaded by the classloader)Instantiation (Object of the Generated Servlet is created).Initialization ( jspInit() method is invoked by the container).Reqeust processing ( _jspService() method is invoked by the container).Destroy ( jspDestroy() method is invoked by the container).
Help us improve. Please let us know the company, where you were asked this question :
Ans. http protocol on its own is stateless. So it helps in identifying the relationship between multiple stateless request as they come from a single source.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Session info in the request can be intercepted and hence a vulnerability. Cookie can be read and write by respective domain only and make sure that right session information is being passed by the client.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture