Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which servlet and JSP version am I using?

Tags:

java

jsp

servlets

Can you tell me how to know which servlet and JSP version am I using ? I use NetBeans IDE 7.1.2 for creating Servlets and JSP.

like image 956
Sabapathy Avatar asked Jun 30 '13 07:06

Sabapathy


People also ask

What is JSP version?

Jakarta Server Pages (JSP; formerly JavaServer Pages) is a collection of technologies that helps software developers create dynamically generated web pages based on HTML, XML, SOAP, or other document types. Released in 1999 by Sun Microsystems, JSP is similar to PHP and ASP, but uses the Java programming language.

Is JSP same as Java servlet?

Java™ servlets and Java server pages (JSPs) are Java programs that run on a Java application server and extend the capabilities of the Web server. Java servlets are Java classes that are designed to respond to HTTP requests in the context of a Web application.

Is JSP and servlets still used?

Servlets and JSPs are considered outdated technologies and no longer chosen for the new projects. These were found in use significantly for legacy projects. Servlet JSPs were used enormously in around 2000. With the popularity of emerging MVC frameworks like Struts, Webwork, Spring etc.

What is JSP difference between JSP and servlet?

Servlets can accept and process all type of protocol requests. JSP on the other hand is compatible with HTTP request only. In Servlet by default session management is not enabled, the user has to enable it explicitly. On the other hand in JSP session management is automatically enabled.


2 Answers

You can easily check the JSP,SERVER and SERVLET version. Add the following code in your jsp page after that run using any IDE Tools.

Server Version: <%= application.getServerInfo() %><br> Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %> JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %> <br> 
like image 83
Kannan Arumugam Avatar answered Sep 28 '22 03:09

Kannan Arumugam


You can get the details programatically using ServletContext #getMajorVersion() and #getMinorVersion().

For knowing the JSP version corresponding to the Servlet, you can get details from this Tomcat page.

Below is a brief summary (check Tomcat's corresponding version at the link above):

  • Servlet 4.0 uses JSP 2.3
  • Servlet 3.1 uses JSP 2.3
  • Servlet 2.5 uses JSP 2.1
  • Servlet 2.4 uses JSP 2.0
  • Servlet 2.3 uses JSP 1.2
  • Servlet 2.2 uses JSP 1.1
  • Servlet 2.1 uses JSP 1.0
like image 43
Vikas V Avatar answered Sep 28 '22 05:09

Vikas V