You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jürgen Jakobitsch <j....@semantic-web.at> on 2011/12/29 09:43:45 UTC

403 jsp - display required roles

hi,

i have a custom 403 error page.
on that page i'd like to display the securityConstraints that apply
to the requested resource.

example :

i have a securityConstraint in my web.xml that says that only users with role "X"
are allowed to view resource "myPage".
when someone tries to access "myPage" without being in the role "X", i'd like to
display "Role "X" is required to view "myPage""

is there a way to access the security constraints defined in web.xml from within
a jsp?

any pointer really appreciated
wkr http://www.turnguard.com/turnguard


-- 
| Jürgen Jakobitsch, 
| Software Developer
| Semantic Web Company GmbH
| Mariahilfer Straße 70 / Neubaugasse 1, Top 8
| A - 1070 Wien, Austria
| Mob +43 676 62 12 710 | Fax +43.1.402 12 35 - 22

COMPANY INFORMATION
| http://www.semantic-web.at/

PERSONAL INFORMATION
| web   : http://www.turnguard.com
| foaf  : http://www.turnguard.com/turnguard
| skype : jakobitsch-punkt

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 403 jsp - display required roles

Posted by Pid <pi...@pidster.com>.
On 29/12/2011 08:43, Jürgen Jakobitsch wrote:
> hi,
> 
> i have a custom 403 error page.
> on that page i'd like to display the securityConstraints that apply
> to the requested resource.
> 
> example :
> 
> i have a securityConstraint in my web.xml that says that only users with role "X"
> are allowed to view resource "myPage".
> when someone tries to access "myPage" without being in the role "X", i'd like to
> display "Role "X" is required to view "myPage""
> 
> is there a way to access the security constraints defined in web.xml from within
> a jsp?

There is no Servlet API for this.

It might be possible to access the web.xml file (on the file system or
by JMX) and reparse it, but I would be cautious about doing this myself.

Seems like a lot of work for very little return.


p


> any pointer really appreciated
> wkr http://www.turnguard.com/turnguard
> 
> 


-- 

[key:62590808]