2

We have a Java EE 6 application for which I realized we still have the Servlet version set to 2.5 (Java EE 5) instead of 3.0 (Java EE 6) in web.xml:

<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         metadata-complete="true">

After:

<web-app version="3.0"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         metadata-complete="true">

Someone then complained that this might have side effects and must be considered a critical change (e.g. for testing/preproduction).

Question(s):

  1. Is this change really critical?
  2. If so, what makes this change "critical", that is what could go possibly go wrong?

I have doubts, because I think that only downgrading could be a problem...

Thanks

Kawu
  • 13,647
  • 34
  • 123
  • 195
  • Why do you need to change it at all? – Kayaman Jan 10 '18 at 12:54
  • Because the actual Servlet version for Java EE 6 is 3.0 and not 2.5. See https://en.wikipedia.org/wiki/Java_EE_version_history ... Why should I **not** do this? – Kawu Jan 10 '18 at 13:29
  • Considering you're just finding it out now, it doesn't seem like it has been a very **essential** aspect of your system. Can you come up with a reason why I shouldn't close this as a duplicate of https://stackoverflow.com/questions/15985378/what-exactly-is-the-web-app-version-what-does-it-affect ? – Kayaman Jan 10 '18 at 13:31
  • I cannot tell for sure whether this is an essential aspect of the application. My suspicion is that it's not. The people who built the application years ago are no longer present, so I cannot tell if the reproach made by my colleague is legitimate or not. He was mumbling something about "testing the entire application", which I do not really concurr with (it's a DB-driven JPA/JSF/PrimeFaces app). I am just seeking a small advice as to what Servlets 3.0 can do over 2.5 without having to read larger parts of the spec. And yeah, reading that posting, it probably is kind of the answer. – Kawu Jan 10 '18 at 16:39

1 Answers1

1

It doesn't really matter whether you leave it as is, or if you change it to 3.0. It will only affect the schema of the web.xml itself, and if it has worked with 2.5 you won't gain or lose anything from changing it. It certainly won't affect the functionality of the program, as all the configuration and code remains the same; you just now have a chance to use 3.0 config elements in your web.xml if you so wished.

The only way it could cause problems is if you deployed it on an ancient servlet engine that didn't support 3.0 and it would object to an unrecognized version. Even then it would be a clear error situation, nothing like the application acting weirdly or having odd bugs.

Kayaman
  • 72,141
  • 5
  • 83
  • 121