struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shriver, Ryan" <>
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.


-----Original Message-----
From: Jay Patel
To: ''
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.
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.

    <!-- Loin form bean -->
    <form-bean      name="loginForm"

    <!-- Process a user login -->
    <action    path="/login"
       <forward name="success"              path="/home.jsp"/>

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-849-0373 Mobile

-----Original Message-----
From: Shriver, Ryan [] 
Sent: Friday, August 24, 2001 2:26 PM
To: ''
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
taglib. I get the following Exception when trying to load login.jsp:

javax.servlet.ServletException: Cannot retrieve mapping for action

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">
    <th align="right">Username:</th>
    <td><input type="text" name="j_username" size="20"></td>
    <th align="right">Password:</th>
    <td><input type="password" name="j_password" size="20"></td>
  <tr align="center">
    <td colspan="2"><input type="submit" value="Login"></td>

This does not:

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

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


View raw message