• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Check the servlet and jsp api version that a container supports?

 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Sorry of it sounds too trivial a question. I maintain a JEE web application running in Tomcat 6.0.29 container. My security team asked me to see if it would be a quick work to upgrade to Tomcat 7 without touching my webappp (or with minimal touching if I have to).

So I thought let's check what JRE version, Servlet spec and JSP spec Tomcat 7 supports in this link - http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html

* First looking into it, I think JRE 5 would be good enough. We are running 5.0.15 version.
* Is the Servlet API version it supports 3.0? Is it the minimal? What if my webapps is written in servlet 2.4?
* Is the JSP API version it supports 2.1? Is it the minimal? What if my webapps is written in JSP 2.0?

And now I wanted to check what my webapp is written in. For that I opened the web.xml file of my app and see the root element has a version attribute that says 2.5. This makes me think our application supports Servlet spec 2.5. Please correct me if I am wrong.

I am not sure how I can check the JSP version. Can you please help me with that?

* Are these version supports forward compatible (a 3.0 servlet container will support servlets written in 2.5 as well or a JSP page written in 2.0 will be working fine in a 2.1 JSP container)?
* Are these version backward compatible otherwise?
* Do I need to update my JRE also for Tomcat 7?

Any guidelines will be appreciated. Thanks in advance.



 
Saloon Keeper
Posts: 28100
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unlike a certain rather large company located in the upper-left corner of the USA, Sun made a point of always supporting backwards compatibility, even when it hurts. Among other things, Java supports a built-in deprecation facility so that you can mark code for later upgrading without making it stop working at 3 am when you need to do an emergency 1-line fix.

In actual fact, even deprecated stuff is rarely removed from the language, and then only years after everyone should have stopped using the deprecated feature. For example, the "broken" Date constructor is still supported (last time I looked, anyway!) even though it has been deprecated for a decade or more.

And what applies to the language also pretty much applies to the frameworks. So test, but figure most stuff is going to keep working just like always. You certainly don't have to upgrade J2EE apps just to run in a JEE container. Unless you want to.

As to language level requirements, check the Tomcat docs for what Tomcat 7 needs.
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim. So looks like I am good. I will test in a Tomcat 7 container anyway to make sure the app is functional once deployed.

As I have figured out the servlet version that my app is using, I am confused if there is an easy way to find out the JSP version my app is using. Any idea how I can find it?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may help: https://coderanch.com/how-to/java/WhichVersionAmIRunningOn
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for the responses. It helps a lot!

Also from this http://tomcat.apache.org/whichversion.html it looks like Tomcat 7 needs at least Java 6. So my code written in Java 5 may or may not work. I will test quickly by deploying it in a Java 6 JRE with my existing Tomcat 6 to confirm I don't have too deprecated methods that won't be backward compatible in Java 6.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ashik Uzzaman wrote:Also from this http://tomcat.apache.org/whichversion.html it looks like Tomcat 7 needs at least Java 6. So my code written in Java 5 may or may not work. I will test quickly by deploying it in a Java 6 JRE with my existing Tomcat 6 to confirm I don't have too deprecated methods that won't be backward compatible in Java 6.


I think you misunderstand what Java's backward compatibility means. Code written for Java version X will almost always work on version X+1, x+2 etc. The other way around is the problem (code written for version X+1 won't generally work on version X).

Also note that -so far- newer versions of Java have never removed methods or classes that were deprecated.
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh that's wonderful! So, if all the deprecated methods are still supported from the birth of Java, I don't have any reason to be worried. Yes, with JRE6, my application still works. I am good then. Thank you all!
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic