java.lang.Throwable is the superclass of all the errors and exceptions in java.
JAVA INTERVIEW QUESTIONS
Interview questions on Java, J2EE, Spring, Struts, Hibernate
Monday, 5 March 2012
Wednesday, 29 February 2012
J2EE: SERVLET: Class GenericServlet vs Class HttpServlet
Class GenericServlet :
· It is an abstract class which defines a generic and protocol independent servlet. Here, protocol independent means, by default, it doesn’t contain inherent support for any particular type of protocol, but it can be extended to provide implementation of any protocol.
· Class GenericServlet implements Interface Servlet and Interface ServletConfig and it belongs to javax.servlet package.
· It offers simpler version of the servlet life cycle methods init() and destroy() and the methods of ServletConfig. That’s why, it makes writing a servlet easier.
· Here, the method service(ServletRequest req, ServletResponse res) is abstract, so the subclasses must override it. And this is also the reason why the GenericServlet is an abstract class.
Tuesday, 28 February 2012
J2EE: SERVLET: What is Servlet Interface?
Interface javax.servlet.Servlet is that interface which defines the ServletLife Cycle methods. So, all servlets must implement this interface, either directly or by extending a class which implements this interface. Instead of directly implementing the Servlet Interface, a servlet can also extend Class GenericServlet (which implements Servlet Interface), or can extend HttpServlet Class (which extends the GenericServlet class).
Monday, 27 February 2012
J2EE: SERVLET: What is Servlet?
Servlet:Servlet is a server-side (runs within a Web server), Java Programming Language Class which interacts with clients via request-response programming model (example, HTTP Request-Response model).It can respond to any type of request, but, generally, it is used to extend the application hosted by Web Server by providing dynamic web content.It has build-in threading capability and provides a secure environment for programming.
Subscribe to:
Posts (Atom)