I am having a problem with the following design.
In my jsp, i'm using the <html:submit> tag with property="action",
but I find that when I want to cancel, I can't prevent the
RequestProcessor
from trying to copy the request form values into a new DynaActionForm.
The problem is that when cancelling, some of the values may be invalid,
but since I don't want to validate, this can throw an exception when
auto
conversions are attempted (that don't succeed) to populate the bean. For
example, if I leave the birthDate field blank, I get:
java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:100)
at
org.apache.commons.beanutils.converters.SqlDateConverter.convert(SqlDate
Converter.java:157)
I guess this is a consequence of the action mapping I've got below. I
really only require the form for update and delete, but not for cancel.
How can I fix this?
Thanks!
Pete
=====
<form-beans>
<form-bean name="detailForm"
dynamic="true"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="firstName" type="java.lang.String" />
<form-property name="lastName" type="java.lang.String" />
<form-property name="birthDate" type="java.sql.Date" />
</form-bean>
</form-beans>
<action path="/famnetProcess"
type="com.cyberpete.famnet.struts.ProcessAction"
name="detailForm"
scope="request"
validate="false"
parameter="action">
<forward name="update" path="/famnetUpdate.do" />
<forward name="delete" path="/famnetDelete.do" />
<forward name="cancel" path="/famnetCancel.do" />
</action>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>