Dave Johnson on open web technologies, social software and software development
« Roller presentation... | Main | Web continuations,... »
I didn't get a good response on the Weblogic forums for this question, so now, dear reader, I bothering you.
If you deploy a simple Servlet/JSP application with an error page on Weblogic 8.1 and your application throws an error, the Servlet Container will save and then restore the contents of your ServletContext. So, if you have any non-serializable ServletContext attributes, you will lose them. (Strange thing is, and this part is definitely a bug, if you deploy the very same application, but without an error page specified in web.xml, then the save and restore will not occur and all of your ServletContext attributes will be preserved.)
This doesn't seem quite right. I realize that the best practice is to only store serializable attributes in your context and in your session, but it is not a requirement of the Servlet specification. If it was a requirement, then setAttribute would take a Serializable rather than just a plain old Object.
Seems to me, non-serializable attributes should only break your application if you try to run in distributed mode. Also, the behavior of ServletContext attributes should be the same regardless of the presence or absence of an error page.
Is this save-and-restore-on-error behavior a bug in Weblogic?
Must context attributes be serializable?
Is there a way to turn off the save-and-restore-on-error behavior on Weblogic?
Dave Johnson in Java
08:48AM Nov 11, 2003
Comments [1]
Tags:
Java
This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog
Below are the most recent entries in the category Java, some may be related to this entry.
Posted by Geert Bevin on November 13, 2003 at 07:31 PM EST #