The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes  how to know which servlet and jsp version Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark " how to know which servlet and jsp version " Watch " how to know which servlet and jsp version " New topic
Author

how to know which servlet and jsp version

siddharth das
Ranch Hand

Joined: Aug 17, 2007
Posts: 115

Can you please tell me how to know which servlet and jsp version ..I am using.
I was trying to see in web.xml, but could not find.
can you please tell me the path of web.xml.
With Regards,
Siddharth Das
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3314

If you want to know the version of JSP and Servlet YOU are using, you only should be aware of as you are making the appropriate use of the features of the versions. For JSP and servlets, we generally do NOT mention the versions specifically as that of XML files.

Whereas if you want to know, what versions are supported in the running/underlying environment -- the Container, you have to read the document/manual from the vendor wherein they would be mentioning the versions of each product/technology.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32767
The ServletContext object has methods called getMajorVersion and getMinorVersion that tell you the Servlet API version. Which JSP version goes with which Servlet version is shown in the link to the Tomcat docs I posted in the other topic where you asked the same question.

In the future, please don't post the same question multiple times.


Android appsImageJ pluginsJava web charts
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
An Java EE application server is a concrete implementation of the JSP/Servlet API's.
The highest supported Servlet/JSP API version is to be found in the specs/docs of the appserver used.
The actually used Servlet API version is to be found in the web.xml root declaration.

The JSP version usually goes hand in hand with the servlet version as follows:
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

You can use this diagnosis in a JSP page to find it out programmatically:


Not to mention that you shouldn't be using scriptlets in real world.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 105
I think one more method is that start your tomcat type URL "http://localhost:8080" you will get the version using bu your server


Cleared SCJP 1.5 | Cleared SCWCD 5.0
SCBCD in progress.....
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 295
Thanks a lot....


Creativity is nothing but Breaking Rules
 
 
subject: how to know which servlet and jsp version
 
Threads others viewed
Using filter with more than one servlet
version for scwcd and the specs ?
How to config jsp in web.xml?
JSP & Servlet Version
How to call JSP function through JavaScript