A JavaBean is nothing but a regular Java Class and hence it can be instantiated using the new keyword and invoking the bean constructor
A Servlet Mapping is a directive in the web.xml that tells the Servlet Container which class to use when a particular Servlet is called. A Servlet is a class within your Java Web Application. Let's say you have a servlet called MyServlet in the com.example.servlet package. You would need to have a Servlet Mapping pointing the path "/MyServlet" to the "com.example.servlet.MyServlet" class. Without the servlet mapping, you would not be able to invoke your servlet because the Servlet container would not know where it is. JSPs are different - they do not need mappings like this. JSPs exist within the WebRoot of the application, so they are always available. Servlets exist in the WEB-INF\Classes directory once your application is deployed.
servlet is a small program which run on serverside,and it can not be downloaded at client side. java servlets dynamically extends the functionalities of a web server. main use is: session tracking: no of users (unique) visited u'r website. in order to use cookies..
The difference is that a GenericServlet has no defined protocol (it is "generic"), while HttpServler uses the HTTP protocol. HttpServlet is a subclass of GenericServlet with the purpose of creating a servlet for a web site.
You cannot. HTML is a static file and it cannot interact with a Java Servlet. A Servlet can always redirect to a HTML page but the other way round cannot happen.
Because it is not a regular Java Class that is executed by a JVM. It is a special Java class that is executed by the Web Container which initializes and loads the servlet and the service methods get executed everytime it receives a request.
A JavaBean is nothing but a regular Java Class and hence it can be instantiated using the new keyword and invoking the bean constructor
Constructor is used to do something (written in constructor) immediately after object creation.
When we are initializing our object with different internal state then we can use the constructor overloading.
Constructor is necessary when you are about to use instance of a class.
default constructor is used only when the programmer does not use a constructor to initialize objects. Once the programmer defines a constructor then the default constructor is no longer used
Java Servlet is used for Server Side programming for developing Web Applications. It easily employs Database Connectivity. We can also use JSP however it cannot replace a Java Servlet.
to create an instance of object
Http servlet and Generic servlet
To create objects of classes
For every class an empty constructor will be defined automatically by default unless you provide a constructor definition manually. Constructor in a class can be used to initialize variables or perfrom some basic functionallity whenever an object is created.
A Servlet Mapping is a directive in the web.xml that tells the Servlet Container which class to use when a particular Servlet is called. A Servlet is a class within your Java Web Application. Let's say you have a servlet called MyServlet in the com.example.servlet package. You would need to have a Servlet Mapping pointing the path "/MyServlet" to the "com.example.servlet.MyServlet" class. Without the servlet mapping, you would not be able to invoke your servlet because the Servlet container would not know where it is. JSPs are different - they do not need mappings like this. JSPs exist within the WebRoot of the application, so they are always available. Servlets exist in the WEB-INF\Classes directory once your application is deployed.