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: '[EMAIL PROTECTED]'
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
[EMAIL PROTECTED]
 


-----Original Message-----
From: Shriver, Ryan [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 24, 2001 2:26 PM
To: '[EMAIL PROTECTED]'
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

Reply via email to