Wednesday, 13 June 2018

Servlet and JSP Interview Questions



  • . What are Servlets?
  • · What are advantages of servlets over CGI?
  • · Can you explain Servlet life cycle?
  • · What are the two important API’s in for Servlets?
  • · Can you explain in detail “javax.servlet” package?
  • · What’s the use of Servlet Context?
  • · How do we define an application level scope for servlet?
  • · What's the difference between Generic Servlet and Http Servlet?
  • · Can you explain in detail javax.servlet.http package?
  • · What’s the architecture of a Servlet package?
  • · Why is HTTP protocol called as a stateless protocol?
  • · What are the different ways we can maintain state between requests?
  • · What is URL rewriting?
  • · What are cookies?
  • · What are sessions in Servlets?
  • · What the difference is between get Session (true) and get Session (false)?
  • · What’s the difference between “do Post” and “do get” methods?
  • · Which are the different ways you can communicate between servlets?
  • · What is functionality of “Request Dispatcher” object?
  • · How do we share data using “get Servlet Context ()”?
  • · Explain the concept of SSI?
  • · What are filters in JAVA?
  • · Can you explain in short how do you go about implementing filters using Apache Tomcat?
  • · Explain step by step of how to implement filters?
  • · What’s the difference between Authentication and authorization?
  • · Explain in brief the directory structure of a web application?
  • · Can you explain JSP page life cycle?
  • · What is EL?
  • · How does EL search for an attribute?
  • · What are the implicit EL objects in JSP?
  • · How can we disable EL?
  • · What is JSTL?
  • · Can you explain in short what the different types of JSTL tags are?
  • · (I) How can we use beans in JSP?
  • · What is the use of <jsp: include>?
  • · What is <jsp: forward> tag for?
  • · What are JSP directives?
  • · What are Page directives?
  • · What are including directives?
  • · Can you explain taglib directives?
  • · How does JSP engines instantiate tag handler classes’ instances?
  • · What’s the difference between JavaBeans and taglib directives?
  • · What are the different scopes an object can have in a JSP page?
  • · What are different implicit objects of JSP?
  • · What are different Authentication Options available in servlets?
  • · Can you explain how do we practically implement security on a resource?
  • · How do we practically implement form based authentication?
  • · How do we authenticate using JDBC?
  • · Can you explain JDBCRealm?
  • · Can you explain how do you configure JNDIRealm?
  • · How did you implement caching in JSP?
  • · What is the difference between Servletcontext and ServletConfig?
  • · How do we prevent browser from caching output of my JSP pages?
  • · Can we explicitly destroy a servlet object?
Best Of Luck

1 comment: