This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filters and UnavailableException" Watch "Filters and UnavailableException" New topic

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

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.
I agree. Here's the link:
subject: Filters and UnavailableException
Similar Threads
Page level authorization
Logging while clicking on link
I want to filter some javaranch pages for reading?
WA #1.....word association