• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to know which servlet and jsp version

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2458
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think one more method is that start your tomcat type URL "http://localhost:8080" you will get the version using bu your server
 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot....
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic