aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
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: 124

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: 3344

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: 42289
    
  64
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.


Ping & DNS - my free Android networking tools app
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.
ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 108
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
SCDJWS 6 in progress.....
santhosh.R gowda
Ranch Hand

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


Creativity is nothing but Breaking Rules
Bob Paris
Greenhorn

Joined: Jun 27, 2013
Posts: 1
Bauke,

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

Okay .. so Im not seeing it. If you are using jsp to build your site, what do you use instead of the scriplets?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Bauke has long since stopped visiting this site (you're replying to a topic that was discussed back in 2009), so I'll give it a shot: You'd use JSPs without scriptlets. All the business and backend logic would be in servlets, and classes or layers called from it. A JSP is just for generating the textual output (meaning: HTML) of the computation that happens in the Java code. Combined with the JSTL and EL, there's no need for JSPs to contain Java code in the shape of scriptlets.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to know which servlet and jsp version