wood burning stoves
The moose likes EJB and other Java EE Technologies and the fly likes Authorization Interceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Authorization Interceptor" Watch "Authorization Interceptor" New topic

Authorization Interceptor

Tim Sparg
Ranch Hand

Joined: Dec 29, 2006
Posts: 40
Hi guys

I have the an Authorization Interceptor that only allows something to proceed if it it has the correct role.

This is implemented as follows:

Here is a simple example of something that the interceptor will go around.

This works correctly, however the Application Server returns a HTTP 500 exception.
How would I make the server return a HTTP 401 (Unauthorised) Exception instead of the 501?

There is no insanity so devastating in man's life as utter sanity
It is sorta covered in the JavaRanch Style Guide.
subject: Authorization Interceptor
jQuery in Action, 3rd edition