Java JSB Servlets Question and Answers

13. What mechanisms are used by a Servlet Container to maintain Session Information?
  Servlet Container uses Cookies, URL rewriting and HTTPS protocol information to maintain the session.
 
Your Name Your Email-ID
Your Answer
14. What is JSP Scriptlet?
  JSP Scriptlet is a jsp tag which is used to enclose a java code in the JSP pages. Scriptlets begins with <% tag and ends with %?> tag. Java code written inside scriptlet executes every time the JSP is invoked.
Example:
<%
// java codes
String userName = null;
username = request.getParameter ("userName") ;
%>
 
Your Name Your Email-ID
Your Answer
15. What are the methods of HttpServlet?
  The methods of HttpServlet class are
  • doGet() is used to handle the GET, conditional GET, and HEAD requests
  • doPost() is used to handle POST requests
  • doPut() is used to handle PUT requests
  • doDelete() is used to handle DELETE requests
  • doOptions() is used to handle the OPTIONS requests and
  • doTrace() is used to handle the TRACE requests
 
Your Name Your Email-ID
Your Answer
16. How does EL search for an attribute?
  EL parser searches the attributes in following order:
  • Page
  • Request
  • Session
  • Application
 
Your Name Your Email-ID
Your Answer
123456789101112131415


Page 4 of 15