You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Gin" <Gi...@NielsenMedia.com> on 2003/03/17 22:39:43 UTC

struts auto validation not displaying

Hi all,
   I have a dynaform field that is being validated but it is not displaying
the error msg.
I matched everything up several times to make sure everything was there but
its still not showing the error messages. I know its validating though
because it will return me back to my page.
Even a view source of the post error page just shows a blank where the
html:errors should have put the error. If I manually create an error and
save it however, it will display correctly.
 (btw.. the unknown="false" is because i'm using xdoclet to build the
struts-config and I have no idea why its putting that in. It doesnt seem to
harm anything though.
Can anyone see what I'm doing wrong?
Thanks.
-Tim

// application resource
# prompt text
prompt.company.name=A company name is required to search on

// jsp page
...
<html:errors/>
...

//struts-config
<form-beans>
  <form-bean name="selectCompanyForm"
type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="companyName" type="java.lang.String"/>
  </form-bean>
</form-beans>

...

    <action path="/companySearch"
      type="com.mam.ui.action.CompanySearchAction"
      name="selectCompanyForm"
      scope="request"
      input="select.company.page"
      unknown="false"
      validate="true"
    >

...

<set-property property="pathnames"
	
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-dyna.xml"/>

// validation-dyna.xml
	<formset>
		<form name="selectCompanyForm">
			<field property="companyName" depends="required">
				<arg0 key="prompt.company.name"/>
			</field>
		</form>
	</formset>

-Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org