This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deciphering the Servlet Spec (2.4)

 
David Bates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Spec Says...

In section 9.7.2 - "Web Application Class Loader" (Page 72) it states:

As described in the J2EE license agreement, servlet containers that are not part of a J2EE product should not allow the application to override J2SE platform classes, such as those in the java.* and javax.* namespaces, that J2SE does not allow to be modified.

Also, servlet containers that are part of a J2EE product should not allow the application to override J2SE or J2EE platform classes, such as those in java.* and javax.* namespaces, that either J2SE or J2EE do not allow to be modified.


By "J2EE product" does it mean "full J2EE server (web and EJB container)"?


My Summary

Is my summary below correct?

Servlet containers should not allow the application to override SE platform classes (java.*, javax.*) which SE doesn't allow to be modified. If the container is in a server with an EJB container, it should prevent the alteration of platform classes that EE doesn't allow.

Looking at this summarised statement above it seems rather pointless. We all know that Java will prevent you from subclassing "final" classes, so why does the container have to do anything special? What's the point in stating the obvious?


What made me read this section of the Spec

In the HF book (Page 615) it says the following statement is INCORRECT:

"A web application may override any J2EE classes in the javax.* namespace"


Contrary to what the book says, isn't this statement only incorrect because it says any class may be overridden? To make it correct it need only be changed to:

"A web application may override any non-final J2EE classes in the javax.* namespace"

Right?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm wondering if instead of saying override, which in Java parlance means to subclass and replace method implementations, it doesn't mean that a Servlet container can't provide THEIR OWN IMPLEMENTATION OF java and javax packages. So, instead of overriding, implying that the container provides their own implementation of basic, standard, J2SE packages.

Just a hunch from a quick read.

-Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic