Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how can we know the version of servlets and jsp  RSS feed

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
can anyone please tell me how to get the version of jsp and also servlets?

please tell me the easiest way to do

thanx in advance


cinux
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean a container implementation of the J2EE 1.4 spec, some people (inc me) use tomcat (http://jakarta.apache.org) how ever there are a few others
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext class gives two methods getMajorVersion() and getMinorVersion(). If the servlet API version in 2.4, the former returns 2 and the latter returns 4. The returned value will be the version supported by your container.
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ouch! ServletContext interface is what i meant, not a class
 
Vikas Bhatia
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saikrishna cinux:
hi,
can anyone please tell me how to get the version of jsp and also servlets?

please tell me the easiest way to do

thanx in advance


cinux


For JSP you can use the JspFactory class to return a JspEngine object

<html>
<body>

<%= JspFactory.getDefaultFactory().getEngineInfo()

</body>
</html>

cheers,

Vikas
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!