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).
* 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.
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.
Sometimes the only way things ever got fixed is because people became uncomfortable.
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.
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.
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!