You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Weber, Jeremy" <JW...@Eventra.com> on 2002/12/19 16:46:46 UTC
More Validation Problems
I thought I had this licked in my first form. I was able to get the default
validations to work along with a couple of custom ones:) However, not on a
subsequent form. The required validation and two custom ones work on the
first form, but not on the second. Its like the never even are attempted.
So once again I am stuck.:( Can anyone give me any suggestions on trouble
shooting a validation that doesnt get called. Maybe some advanced logging
switches or something to that extent. I have also included portions of my
config files if it may help.
Anyway, if you can think of anything, thanks again.
Jeremy
APPSERVER.JSP
-------------
<html:form action="AppServerFormBean.do">
<table bgcolor=white border=0 width="45%">
<tr valign>
<td><bean:message key="appserver.fileowner.displayname"/></td>
<td><html:text property="fileOwner" size=25
styleClass="input"/></td>
</tr>
<tr valign>
<td><bean:message key="appserver.ownergroup.displayname"/></td>
<td><html:text property="ownerGroup" size=25
styleClass="input"/></td>
</tr>
<tr valign>
<td><bean:message key="appserver.url.displayname"/></td>
<td><html:text property="url" size=25 styleClass="input"/></td>
</tr>
...
<tr><td colspan=2><html:submit/></td></tr>
</html:form>
VALIDATION.XML
--------------
<formset>
<form>
First Form Works
</form>
<form name="AppServerFormBean">
<field property="fileOwner" depends="path">
<arg0
key="appserver.fileowner.displayname"/>
</field>
<field property="ownerGroup" depends="required">
<arg0
key="appserver.fileowner.displayname"/>
</field>
<field property="url" depends="required,mask">
<arg0 key="appserver.url.displayname"/>
<var>
<var-name>mask</var-name>
<var-value>^http.*$</var-value>
</var>
</field>
</form>
</formset>
VALIDATION-RULES (this works on first form)
-------------------------------------------
<validator name="path"
classname="com.vendorsite.install.util.validate.VsValidate"
method="validatePath"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
msg="errors.path">
</validator>
STRUTS-CONFIG.XML
-----------------
<form-beans>
....
<form-bean name="AppServerFormBean"
type="com.vendorsite.install.beans.AppServerFormBean"/>
</form-beans>
<action path="/AppServerFormBean"
type="com.vendorsite.install.actions.AppServerFormAction"
name="AppServerFormBean"
input="/appserver.page"
scope="page"
redirect="true"
validate="true">
<forward name="success" path="/database.page"/>
<forward name="failure" path="/appserver.page"/>
</action>
<action path="/appserver"
type="com.vendorsite.install.actions.DefaultSubmitAction">
<forward name="success" path="appserverDef"/>
</action>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>