wood burning stoves*
The moose likes Servlets and the fly likes Filters and UnavailableException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filters and UnavailableException" Watch "Filters and UnavailableException" New topic
Author

Filters and UnavailableException

Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
If an implementation of javax.servlet.Filter.init() throws javax.servlet.UnavailableException(), shouldn't the container not add the filter to the FilterChain? I'm getting an HTTP 503 error from OC4J in this case.
Siyaa Hoffman
Greenhorn

Joined: Jan 15, 2004
Posts: 23
If your filter is not initializing successfully, then I don't think that the context would be even successfully loaded....not sure about OC4J...but tomcat behaves that way. It would not even let you load the web application context successfully if the filter cannot be initialized.
Rick DeBay
Ranch Hand

Joined: Jul 11, 2003
Posts: 70
The filter requires parameters to be set correctly, so inside init() if the parameters are incorrect or missing, I throw the exception. I was hoping that the container would continue without the filter. But I guess it makes more sense that it wouldn't.
 
jQuery in Action, 2nd edition
 
subject: Filters and UnavailableException
 
Similar Threads
Filters?
Page level authorization
Logging while clicking on link
I want to filter some javaranch pages for reading?
WA #1.....word association