commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn, Paul" <>
Subject RE: Struts & Validator question
Date Mon, 24 Nov 2003 03:08:16 GMT

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 


-----Original Message-----
From: LACKEY,DAVID (HP-PaloAlto,ex1) []
Sent: Sunday, November 23, 2003 9:40 PM
To: ''
Subject: Struts & Validator question


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

<form-bean 	name="orgForm" 
<!-- Insert a new Org into the database -->
<action path="/org_insert"
	input="org_edit.jsp" >
	<forward name="show_list" path="/" />
	<forward name="error" path="/" />
<message-resources parameter=""/>
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,


        <form name="orgForm">
    	      <field property="orgCode"
                <arg0 key="orgForm.OrgCode"/>

errors.required={0} is required.

In the org_edit.jsp file contains the following code snippet:
   <bean:message key="errors.header"/>
   <html:messages id="error">
      <li><bean:write name="error"/></li>

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


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message