It's not a secret anymore!*
The moose likes Servlets and the fly likes @RolesAllowed, @PermitAll, etc Servlet . with Tomcat JDBC Realm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "@RolesAllowed, @PermitAll, etc Servlet . with Tomcat JDBC Realm" Watch "@RolesAllowed, @PermitAll, etc Servlet . with Tomcat JDBC Realm" New topic
Author

@RolesAllowed, @PermitAll, etc Servlet . with Tomcat JDBC Realm

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hello friends..

i've a doubt about Servlet and Tomcat JDBC Realm..
i've two user credential, manager and admin
assume that i've configured Tomcat JDBC Realm.. does realm recognized in Servlet?..

i've configured Servlet like this instance..


then how to get User's Role for used on Servlet?

Thanks in advance..


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Please help me and correct me if iam wrong..

Yap, iam just greenhorn..
Thanks in advance...
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

I don't know if @RolesAllowed can be used with Servlets or not. I think it is not supported on glassfish at least (reference). I think it will be supported after servlet 3.0 as given here. You can refer to this tutorial to see how to do this with configuration in web.xml file...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
As far as I can tell, the servlet API for 2.5 and earlier did not provide for any annotations. All configuration was via web.xml.

NOW - some projects, such as Jersey, used annotations but that was outside the servlet API.

Using annotations for configuration is one of the big jumps for servlet 3.0. Here is the JSR for servlet 3.0.

Where did you see RolesAllowed in use?

Bill
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

is there any another way to configure roles in Servlet 2.5?..

i think i wanna save the role in Session.. (firstly, i save the role in Session when access Login Servlet)
and check it every access to Servlet.. .. yap, i think it's really "ticklish" to configure..
this is my implementation :


please correct me if i'm wrong..

Thanks in advance..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @RolesAllowed, @PermitAll, etc Servlet . with Tomcat JDBC Realm
 
Similar Threads
can WebLogic 6.0 use a JDBC realm?
BASIC authentication not working
IIS Integrated Authentication + Tomcat Form-based (or basic) Authentication
what is realm. ???
Database realm in OC4J