RE: Cannot Retrieve Mapping for Action
Chandra, Remove the .do from you action attribute in the form definition: %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html head /head body html:form method=post action=/logon . . . HTH. Regards, Todd -Original Message- From: Chandrasekar [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 12:36 AM To: Struts Users Mailing List Subject: Cannot Retrieve Mapping for Action Hi , First sorry for a lengthy mail. Searched the mailing list archive and tried every solution suggested there ... still nothing ... I am getting the following error when trying to invoke the login page.(Using weblogic 6.0) Aug 29, 2002 9:39:13 AM IST Error HTTP [WebAppServletContext(6765727,wisor repwebapp)] Root cause of ServletException javax.servlet.jsp.JspException: Cannot retrieve mapping for action /logon at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:784) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481) at jsp_servlet.__login._jspService(__login.java:123) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImp l.java:213) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSer vletContext.java:1302) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImp l.java:1680) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Below are my configuration details web.xml servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-namevalidate/param-name param-valuefalse/param-value /init-param load-on-startup2/load-on-startup /servlet !-- Standard Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping struts-config.xml file struts-config form-beans form-bean name=loginForm type=com.wisor.pom.formbeans.LoginFormBean/ /form-beans global-forwards forward name=loginForm path=/Login.jsp/ /global-forwards action-mappings action path=/logon type=com.wisor.pom.action.LoginAction name=loginForm input=/Login.jsp scope=request validate=true forward name=success path=/Login.jsp / forward name=failure path=/Login.jsp / /action /action-mappings /struts-config // all my Action and ActionForm classes are available inside the WEB-INF/classes directory // JSP pages available inside webapp directory my JSP page %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html head /head body html:form method=post action=/logon.do html:text property=username / html:text property=password / html:submit/ /html:form /body /html:html Thanks Chandra -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot retrieve mapping for action /loginForm error
I think your action should be 'login'. 'loginForm' is your form bean. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:32 AM To: Struts Users Mailing List Subject: Cannot retrieve mapping for action /loginForm error Hi, I am getting this error, please find the mappings from struts-cong below form-bean name=loginForm dynamic=true type=org.apache.struts.validator.DynaValidatorForm form-property name=system type=java.lang.String/ form-property name=userId type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean action path=/login type=com.pfizer.maps.LoginAction name=loginForm scope=request validate=true input=index.jsp forward name=error path=/index.jsp/ forward name=success path=/index.jsp/ /action and i have class com.pfizer.maps.LoginAction in web-inf/classes/com/pfizer/maps so what wrong i am doing , please help ASAP javax.servlet.jsp.JspException: Cannot retrieve mapping for action /loginForm at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:871) Ashish A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot retrieve mapping for action /loginForm error
Hi, which action must be login in form-bean or action mapping, also since i am using DynaValidatorForm, i have no class loginForm bean, so what will be the form-name if using DynaValidatorForm Ashish Sri Sankaran wrote:I think your action should be 'login'. 'loginForm' is your form bean. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:32 AM To: Struts Users Mailing List Subject: Cannot retrieve mapping for action /loginForm error Hi, I am getting this error, please find the mappings from struts-cong below dynamic=true type=org.apache.struts.validator.DynaValidatorForm and i have class com.pfizer.maps.LoginAction in web-inf/classes/com/pfizer/maps so what wrong i am doing , please help ASAP javax.servlet.jsp.JspException: Cannot retrieve mapping for action /loginForm at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:871) Ashish A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: For additional commands, e-mail: A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes
RE: Cannot retrieve mapping for action /loginForm error
I haven't used Struts 1.1 so I can't help you there. Sorry I should have read more carefully before piping up. What was thought was you had (in your jsp) a html:form action='loginForm' tag. If so, that should change to html:form action='login' which, per your action mapping is of type 'com.pfizer.maps.LoginAction'. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:49 AM To: Struts Users Mailing List Subject: RE: Cannot retrieve mapping for action /loginForm error Hi, which action must be login in form-bean or action mapping, also since i am using DynaValidatorForm, i have no class loginForm bean, so what will be the form-name if using DynaValidatorForm Ashish Sri Sankaran wrote:I think your action should be 'login'. 'loginForm' is your form bean. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:32 AM To: Struts Users Mailing List Subject: Cannot retrieve mapping for action /loginForm error Hi, I am getting this error, please find the mappings from struts-cong below dynamic=true type=org.apache.struts.validator.DynaValidatorForm and i have class com.pfizer.maps.LoginAction in web-inf/classes/com/pfizer/maps so what wrong i am doing , please help ASAP javax.servlet.jsp.JspException: Cannot retrieve mapping for action /loginForm at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:871) Ashish A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: For additional commands, e-mail: A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot retrieve mapping for action /loginForm error
hi got the problem i had defined in html:form action='loginForm which i changed to login and it worked, thanx for the help Sri Sankaran wrote:I haven't used Struts 1.1 so I can't help you there. Sorry I should have read more carefully before piping up. What was thought was you had (in your jsp) a tag. If so, that should change to which, per your action mapping is of type 'com.pfizer.maps.LoginAction'. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:49 AM To: Struts Users Mailing List Subject: RE: Cannot retrieve mapping for action /loginForm error Hi, which action must be login in form-bean or action mapping, also since i am using DynaValidatorForm, i have no class loginForm bean, so what will be the form-name if using DynaValidatorForm Ashish Sri Sankaran wrote:I think your action should be 'login'. 'loginForm' is your form bean. Sri -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 11:32 AM To: Struts Users Mailing List Subject: Cannot retrieve mapping for action /loginForm error Hi, I am getting this error, please find the mappings from struts-cong below dynamic=true type=org.apache.struts.validator.DynaValidatorForm and i have class com.pfizer.maps.LoginAction in web-inf/classes/com/pfizer/maps so what wrong i am doing , please help ASAP javax.servlet.jsp.JspException: Cannot retrieve mapping for action /loginForm at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:871) Ashish A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: For additional commands, e-mail: A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes -- To unsubscribe, e-mail: For additional commands, e-mail: A$HI$H - Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes
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 -- actionpath=/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=rightUsername:/th tdinput type=text name=j_username size=20/td /tr tr th align=rightPassword:/th tdinput type=password name=j_password size=20/td /tr tr align=center td colspan=2input 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=rightUsername:/th tdhtml:text property=j_username//td /tr tr th align=rightPassword:/th tdhtml:password property=j_password//td /tr tr align=center td colspan=2html:submitLogin/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
RE: Cannot retrieve mapping for action /j_security_check
If you are using container-managed authentication, why use a Struts FormBean? You can get the username from the container using the getCallPrincipal() method of HttpServletRequest to get the logged in user's principal. If you absolutely want to use an ActionForm via Struts, keep reading. You will need to create a FormBean with 2 fields of type String. -- Code for LoginForm.java -- package com.yourcompany.yourapp.LoginForm; //import statements here public class LoginForm extends ActionForm { protected String j_username; protected String j_password; public LoginForm() { super(); } public void setJ_username(String j_username) { this.j_username = j_username; } public String getJ_username() { return j_username; } public void setJ_password(String j_password) { this.j_password = j_password; } public String getJ_password() { return j_password; } //other methods for ActionForm } -- End Code -- You will also have to supply the name and type parameters in the html:form tag -- code for login.jsp -- html:form name=loginForm action=j_security_check method=POST type=com.yourcompany.yourapp.LoginForm scope=session %-- Other html elements --% /html:form -- end code -- You will also need to declare your LoginForm inside struts-config.xml -- code for struts-config.xml -- struts-config form-beans form-bean name=loginForm type=com.yourcompany.yourapp.LoginForm/ !-- other form-bean declarations -- /form-beans !-- other struts-config elements -- /struts-config -- end code -- That should be it, just make sure you setup your web.xml file to use form-based login. James Hicks -Original Message- From: Shriver, Ryan [mailto:[EMAIL PROTECTED]] Sent: Friday, August 24, 2001 2:50 PM To: 'Jay Patel '; ''[EMAIL PROTECTED]' ' Subject: RE: Cannot retrieve mapping for action /j_security_check 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 -- actionpath=/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=rightUsername:/th tdinput type=text name=j_username size=20/td /tr tr th align=rightPassword:/th tdinput type=password name=j_password size=20/td /tr tr align=center td colspan=2input 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=rightUsername:/th tdhtml:text property=j_username//td /tr tr th align=rightPassword:/th tdhtml:password property=j_password//td /tr tr align=center td colspan=2html:submitLogin/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
RE: Cannot retrieve mapping for action /j_security_check
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 -- actionpath=/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=rightUsername:/th tdinput type=text name=j_username size=20/td /tr tr th align=rightPassword:/th tdinput type=password name=j_password size=20/td /tr tr align=center td colspan=2input 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=rightUsername:/th tdhtml:text property=j_username//td /tr tr th align=rightPassword:/th tdhtml:password property=j_password//td /tr tr align=center td colspan=2html:submitLogin/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
Re: Cannot retrieve mapping for action
Tom, Thanks for your help. With all the struts traffic, I missed your response at first. It turns out that my problem was I was I was saying action path=/custom actionClass=custom.GroupAction ... instead of action path=/custom type=custom.GroupAction ... I'm guessing that the tutorial I had been following was an old version of struts. -Brian [EMAIL PROTECTED]
Re: Cannot retrieve mapping for action
Brian, Do you have this servlet mapping in your web.xml? servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping Also, is there a particular reason why you override the mapping parameter with your custom.CustomMapping class? Does it work if you switch back to the default/comment this setting out? Hope this helps, tom Brian K. Buckley wrote: Hi, I'm a brand new Struts user. I installed the struts 1.0 binary and I'm attempting to work through a struts trailmap tutorial (the one at bluestone.com). I am getting a Servlet Exception with the message Cannot retrieve mapping for action /custom when I call a simple input.jsp. My input.jsp, my struts-config.xml and a piece of my web.xml are shown below. Can someone suggest what is causing this errror? Thanks, -Brian * input.jsp** form:form action=custom.do form:submit value=Display Group / /form:form * struts-config.xml** !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config form-beans form-bean name=customForm type=custom.CustomForm/ /form-beans action-mappings action path=/custom actionClass=custom.GroupAction name=customForm set-property property=group value=Struts User/ forward name=view path=/display.jsp / /action /action-mappings /struts-config * piece of web.xml*** servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-namemapping/param-name param-valuecustom.CustomMapping/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namevalidate/param-name param-valuefalse/param-value /init-param init-param param-nameapplication/param-name param-valuehelloworld.HelloWorldResources/param-value /init-param load-on-startup2/load-on-startup /servlet -- thomas quas| Art lies in the consciousness of doing the thing, [EMAIL PROTECTED] | in the attention of the happening[...] |-- Allen Ginsberg --