struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shriver, Ryan" <Ryan.Shri...@whitlockebs.com>
Subject RE: Cannot retrieve mapping for action /j_security_check
Date Fri, 24 Aug 2001 19:49:45 GMT
 Thanks for the quick reply but this seems like too much work just to get
some consistency across my .jsp forms. I would think there would be a way
for struts to let forms posted to j_security_check pass through to the
servlet container instead of the normal Action classes. I want the
container, not Struts, to do my authentication/authorization.

Thanks for the help though.

-ryan

-----Original Message-----
From: Jay Patel
To: 'struts-user@jakarta.apache.org'
Sent: 8/24/2001 3:41 PM
Subject: RE: Cannot retrieve mapping for action /j_security_check

You will need to add the Action mapping in your struts-config.xml file.
You
will also need the form-bean mapping that your form will use to pass the
form data to the action class.

Here is an example.

<form-beans>
    <!-- Loin form bean -->
    <form-bean      name="loginForm"
                    type="com.dextera.examples.forms.LoginForm"/>
</form-beans>

<action-mappings>
    <!-- Process a user login -->
    <action    path="/login"
               type="com.dextera.examples.actions.LoginAction"
               name="loginForm"
              scope="request"
              input="/login.jsp">
       <forward name="success"              path="/home.jsp"/>
</action-mappings>

All in all you will need the following:

1. A form bean to carry the data
2. Action servlet to perform your action
3. Form bean declaration in struts-config
4. Action mapping in struts-config

Good luck.


Jay Patel
972-701-9773
972-849-0373 Mobile
jpatel@dexteragroup.com
 


-----Original Message-----
From: Shriver, Ryan [mailto:Ryan.Shriver@whitlockebs.com] 
Sent: Friday, August 24, 2001 2:26 PM
To: 'struts-user@jakarta.apache.org'
Subject: Cannot retrieve mapping for action /j_security_check


Hello all,
I looked in the archives but couldn't find an answer to my question. I'd
like to convert my working form-based login page to use struts' html
form
taglib. I get the following Exception when trying to load login.jsp:

javax.servlet.ServletException: Cannot retrieve mapping for action
/j_security_check

I was hoping someone could help out with the conversion. This works:

<form name="login" action="j_security_check" method="POST">
  <table border="3" cellpadding="2" cellspacing="2" align="center">
  <tr>
    <th align="right">Username:</th>
    <td><input type="text" name="j_username" size="20"></td>
  </tr>
  <tr>
    <th align="right">Password:</th>
    <td><input type="password" name="j_password" size="20"></td>
  </tr>
  <tr align="center">
    <td colspan="2"><input type="submit" value="Login"></td>
  </tr>
  </table>
</form>

This does not:

<html:form action="j_security_check" focus="j_username">
  <table border="3" cellpadding="2" cellspacing="2" align="center">
  <tr>
    <th align="right">Username:</th>
    <td><html:text property="j_username"/></td>
  </tr>
  <tr>
    <th align="right">Password:</th>
    <td><html:password property="j_password"/></td>
  </tr>
  <tr align="center">
    <td colspan="2"><html:submit>Login</html:submit></td>
  </tr>
  </table>
</html:form>

I'm hoping all I need to do is add an entry in struts-config.xml, but
I'm
not sure what that entry should be. Any help would be appreciated.

-ryan

Mime
View raw message