commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LACKEY,DAVID (HP-PaloAlto,ex1)" <david.lack...@hp.com>
Subject RE: Struts & Validator question
Date Mon, 24 Nov 2003 06:46:01 GMT
Hi Paul,

I have tried it with & without the '/' and I have tried pointing to a
forward and an action forward.  Each of which with the "/" and/or the .do
suffix.  However, nothing seems to work.  There is one other notable piece
of information.  When I do have the "input" parameter pointed to a forward,
I am presented with an error in the browser telling me that the server was
unable to retrieve a mapping for /misc.  I have never had any items named
"misc" defined in my struts-config.xml file.

David

> -----Original Message-----
> From: Glenn, Paul [mailto:Paul.Glenn@CIBC.ca]
> Sent: Sunday, November 23, 2003 7:08 PM
> To: 'Jakarta Commons Users List'
> Subject: RE: Struts & Validator question
> 
> 
> Hi,
> 
> I think your problem is with the input attribute of your
> action. This is where the page is forwarded to if there is a 
> validation error. You might need to qualify the page location 
> (add a '/') or as I usually do, point to the action rather 
> than the jsp (if an action loads the input page, as it might 
> have some processing that the page 
> requires).
> 
> 
> Paul
> 
> -----Original Message-----
> From: LACKEY,DAVID (HP-PaloAlto,ex1) [mailto:david.lackey2@hp.com]
> Sent: Sunday, November 23, 2003 9:40 PM
> To: 'commons-user@jakarta.apache.org'
> Subject: Struts & Validator question
> 
> 
> All
> 
> I hope this is not a newbie question.  I have RTFM several
> times.  I suspect I must be missing something simple.  I have 
> installed Tomcat 4.1.29 and Struts 1.1 with the Validator 
> included.  I have configured my installation as follows
> 
> struts-config.xml:
> <form-bean 	name="orgForm" 
> 	type="com.hp.ipg.ne.pgpm.forms.orgForm"/>
> .
> .
> .
> <!-- Insert a new Org into the database -->
> <action path="/org_insert"
> 	name="orgForm"
> 	type="com.hp.ipg.ne.pgpm.actions.orgInsertAction"
> 	scope="request"
> 	validate="true" 
> 	input="org_edit.jsp" >
> 	<forward name="show_list" path="/org_list.do" />
> 	<forward name="error" path="/GeneralError.do" />
> </action>
> .
> .
> .
> <message-resources parameter="com.hp.ipg.ne.pgpm.application"/>
> .
> .
> .
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathnames"
> value="/WEB-INF/validator-rules.xml,
>                                               
> /WEB-INF/validation.xml"/>
>   </plug-in>
> 
> Validation.xml:
> 
> <form-validation>
>     <formset>
>         <form name="orgForm">
>     	      <field property="orgCode"
> 		        depends="required">
>                 <arg0 key="orgForm.OrgCode"/>
>             </field>
>         </form>
>     </formset>
> </form-validation>
> 
> Application:properties:
> errors.required={0} is required.
> 
> In the org_edit.jsp file contains the following code snippet:
> <logic:messagesPresent>
>    <bean:message key="errors.header"/>
>    <ul>
>    <html:messages id="error">
>       <li><bean:write name="error"/></li>
>    </html:messages>
>    </ul><hr>
> </logic:messagesPresent>
> 
> 
> I have stepped through the execution several times and see
> the validator being activated.  I even see the failed 
> validation (empty field).  However, after the failed 
> validation, it seems validator is unable to construct a 
> proper forward to send me back to the JSP page where the 
> error was entered (or not entered in this case).  I am simply 
> forwarded to a nearly blank page with minimal <html> and <body> tags.
> 
> Any thoughts would be appreciated.
> 
> 
> David Lackey
> David.lackey2@hp.com
> 
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 

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


Mime
View raw message