This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to know which servlet and jsp version

 
siddharth das
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • 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
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
ankit kumar
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot....
 
Bob Paris
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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: 42968
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic