• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and JDBC/realm

kelly goedert
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I trying to use roles in my application, like an administrator can do anything and other users cannot. I using JDBC realm for that but it doesn't seem to be working.
Here is my struts-config.xml
<!-- Action Mapping Definitions -->
<action path="/login"
name = "loginForm"
<action path="/adm"
roles = "adm"
forward = "/adm.jsp">
<action path="/user"
roles = "user"
forward = "/usr.jsp">
<action path="/principal"
forward = "/principal.jsp">
And here is my web.xml (the security part)
<!-- Define the context-relative URL(s) to be protected -->
<!-- If you list http methods, only those methods are protected -->
<!-- Anyone with one of the listed roles may access this area -->
<!-- Default login configuration uses form-based authentication -->
<realm-name>Example Form-Based Authentication Area</realm-name>

<!-- Security roles referenced by this web application -->

In my login form the action is called like this
<html:form action="/login">
I would like that after the login I would go to principal.jsp and there I would have two links: one to be accessed by adm users and other to be used by the ones with "user" role.
What I'm doing wrong?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic