This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Authorization Interceptor" Watch "Authorization Interceptor" New topic
Author

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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Authorization Interceptor
 
jQuery in Action, 3rd edition