aspose file tools*
The moose likes Struts and the fly likes Cannot retrieve mapping for action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot retrieve mapping for action" Watch "Cannot retrieve mapping for action" New topic
Author

Cannot retrieve mapping for action

Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Hi
I am pretty new to Struts. So please bear with me if my question is little childish. I have a JSP which is supposed to call an action but when i hit the submit button, i get an exception that reads "Cannot retrieve mapping for action". Could you please help me out in resolving this...


The JSP that calls the action looks like


The struts config for the action looks like


I also have a form bean that has its definition in struts-config


Thanks

karthick.v@tcs.com


Karthik <br />SCJP 1.4 SCWCD 1.4 SCBCD 1.3
Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
A small correction with my query. The JSP itself is not loading now and i am getting the same exception "Cannot retrieve mapping for action"
anupa oru
Ranch Hand

Joined: Jan 15, 2005
Posts: 118
Hi,
according to my knowledge you have to include the name of JSP to which form bean needs to be associated in input attribute of <action> tag in struts-config file
I hope this will work out.
Let me know how it helps.
Thanks
anupa
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Hi Karthik,

If you are providing name attributr in <html:form> you should also specify the type attribute.
so try with this

<hr/ >
<html:form action="XXXX" >
<hr/ >
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Hi Karthik,

If you are providing name attributr in <html:form> you should also specify the type attribute.
so try with this

Hemanth Pallavajula
Ranch Hand

Joined: Oct 07, 2004
Posts: 38
hi,

I think the value for action attribute of <html:form> should be "AddressValidate.do".

Correct me If I am wrong.


Cheers,<br />Hemanth...<br />(When opportunity doesn't knock, build a door.)
Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Hi
I checked with other JSP's in the application. They dont seem to have ".do" extension for the action.
JSun Online
Greenhorn

Joined: Mar 11, 2005
Posts: 1
Check ur web.xml for your action servlet , and servlet mapping given correctly ,,
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

-----------------------
Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Hi
I checked web.xml. It looks fine. Also all other JSP's are working fine. So, i am not sure if it is a problem with web.xml.

Thanks
Karthik
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Originally posted by karthikntcs vijayarajan:
"Cannot retrieve mapping for action"


I think there is some problem with struts-config file. may be some typo errors.
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Originally posted by Hemanth Pallavajula:
hi,

I think the value for action attribute of <html:form> should be "AddressValidate.do".

Correct me If I am wrong.


I think .do is not mandotary.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Cannot retrieve mapping for action