File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes DynaActionForm with ActionMapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DynaActionForm with ActionMapping" Watch "DynaActionForm with ActionMapping" New topic

DynaActionForm with ActionMapping

Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63
I am trying to tie my JSP to a DynaActionForm and Action Class.
When I try to view page I receive error
"javax.servlet.jsp.JspException: Cannot retrieve mapping for action /submitForm"

Here is how my form-bean, action-mapping, and form look.

<form-bean name="submitForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="foo1" type="java.lang.String" />
<form-property name="foo2" type="java.lang.String" />


<html:form action="/submitForm" focus="MedicareNumber">
<fmt:message key="label.foo1"/><html:text property="foo1"/>
<fmt:message key="label.foo2"/><html:text property="foo2"/>
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

It is case sensitive. Look at the 'S'.

A good workman is known by his tools.
Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63

Thanks for pointing that out. Ironically while it looks like a capitalization error, which it kind of is... That was not really my problem.

I thought that in the <html:form> tag that the action attribute was supposed to coincide with the action-mapping name attribute. From what you said, and then changing my form tag it appears the <html:form> action attribute should coincide with the action-mapping path attribute instead. Am I understanding correctly now?

I agree. Here's the link:
subject: DynaActionForm with ActionMapping
It's not a secret anymore!