HasanBdit
Basic Knowledge of Web Development, Web and Desktop based Software Development.
Thursday, May 7, 2015
Java Servlet
ICT World9: Java Servlet: In the early days, web servers used to deliver static contents that are indifferent to users' requests. But Now-a-days, Java servlets ...
HTTPServlet Class
ICT World9: HTTPServlet Class: HTTPServlet is an abstract class. This class extends GenericServlet and provides base for creating HTTP based web applications. There are m...
Saturday, May 2, 2015
Java Servlet Versions
Java Servlet has these versions:
• J2EE 1.2 (December 12, 1999) (Java Servlet 2.2, JSP 1.1, EJB 1.1, JDBC 2.0)
• J2EE 1.3 (September 24, 2001) (Java Servlet 2.3, JSP 1.2, EJB 2.0, JDBC 2.1)
• J2EE 1.4 (November 11, 2003) (Java Servlet 2.4, JSP 2.0, EJB 2.1, JDBC 3.0)
• Java EE 5 (May 11, 2006) (Java Servlet 2.5, JSP 2.1, JSTL 1.2, JSF 1.2, EJB 3.0, JDBC 3.0)
• Java EE 6 (December 10, 2009) (Java Servlet 3.0, JSP 2.2/EL 2.2, JSTL 1.2, JSF 2.0, EJB 3.1,
JDBC 4.0)
• Java EE 7: expected in end of 2012.
• J2EE 1.2 (December 12, 1999) (Java Servlet 2.2, JSP 1.1, EJB 1.1, JDBC 2.0)
• J2EE 1.3 (September 24, 2001) (Java Servlet 2.3, JSP 1.2, EJB 2.0, JDBC 2.1)
• J2EE 1.4 (November 11, 2003) (Java Servlet 2.4, JSP 2.0, EJB 2.1, JDBC 3.0)
• Java EE 5 (May 11, 2006) (Java Servlet 2.5, JSP 2.1, JSTL 1.2, JSF 1.2, EJB 3.0, JDBC 3.0)
• Java EE 6 (December 10, 2009) (Java Servlet 3.0, JSP 2.2/EL 2.2, JSTL 1.2, JSF 2.0, EJB 3.1,
JDBC 4.0)
• Java EE 7: expected in end of 2012.
Web Filter
This annotation is used to declare a servlet filter. This annotation is processed by the
container during deployment, the Filter class in which it is found will be created as per the
configuration and applied to the URL patterns, Servlets and DispatcherTypes. The annotated class
MUST implement javax.servlet.Filter interface.
container during deployment, the Filter class in which it is found will be created as per the
configuration and applied to the URL patterns, Servlets and DispatcherTypes. The annotated class
MUST implement javax.servlet.Filter interface.
Web InitParameters
This annotation is used to define init parameters for servlet or
filter, it contains name, value pair and we can provide description also.
This annotation can be used within a WebFilter or WebServlet annotation.
filter, it contains name, value pair and we can provide description also.
This annotation can be used within a WebFilter or WebServlet annotation.
Web Servlet
We can use this annotation with Servlet classes to define init
parameters,loadOnStartup value, description and url patterns etc. At least
one URL pattern MUST be declared in either the value or urlPattern attribute
of the annotation, but not both. The class on which this annotation is
declared MUST extend HttpServlet.
parameters,loadOnStartup value, description and url patterns etc. At least
one URL pattern MUST be declared in either the value or urlPattern attribute
of the annotation, but not both. The class on which this annotation is
declared MUST extend HttpServlet.
Page URL Servlet
The following table shows some examples of URL that map to specific servelt
to be executed.
Page URL Servlet to execute
http://host:port/mywebapp/fruit/summer/index.html watermelon
http://host:port/mywebapp/fruit/summer/index.abc watermelon
http://host:port/mywebapp/seedlist list
http://host:port/mywebapp/seedlist/index.html The default servlet, if
configured, or an HTTP 404 File
Not Found error message.
If the mapping for the list
servlet had been /seedlist*,
the list servlet would be
invoked.
to be executed.
Page URL Servlet to execute
http://host:port/mywebapp/fruit/summer/index.html watermelon
http://host:port/mywebapp/fruit/summer/index.abc watermelon
http://host:port/mywebapp/seedlist list
http://host:port/mywebapp/seedlist/index.html The default servlet, if
configured, or an HTTP 404 File
Not Found error message.
If the mapping for the list
servlet had been /seedlist*,
the list servlet would be
invoked.
Subscribe to:
Posts (Atom)