You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Samir Shah <sa...@yahoo.com> on 2003/01/03 17:04:08 UTC

DynaValidatorForm data not repopulating

Hi,

I have a form which get populated using bean in the
request object, the use can edit information and
submit it.  The formbean for this defined as below.

	<form-bean name="gotoStep2Form" 
	
type="org.apache.struts.validator.DynaValidatorForm"> 

	    <form-property name="propId"
type="java.lang.String" />
	    <form-property name="propNm"
type="java.lang.String" />
	    <form-property name="effDt"
type="java.lang.String" />
	    <form-property name="crteDt"
type="java.lang.String" />
	    <form-property name="prospectNm"
type="java.lang.String" />
	    <form-property name="strLn1"
type="java.lang.String" />
	    <form-property name="strLn2"
type="java.lang.String" />
	    <form-property name="admnNm"
type="java.lang.String" />
	    <form-property name="admnTtlNm"
type="java.lang.String" />	    	    	    	    	    	  
 	    
	    <form-property name="cityNm"
type="java.lang.String" />
	    <form-property name="admnPhnNbr"
type="java.lang.String" />
	    <form-property name="stateCd"
type="java.lang.String" />
	    <form-property name="admnFaxNbr"
type="java.lang.String" />
	    <form-property name="zipCd"
type="java.lang.String" />
	    <form-property name="admnEMailAddr"
type="java.lang.String" />
	    <form-property name="sicCd"
type="java.lang.String" />
	    <form-property name="sicDesc"
type="java.lang.String" />	    	    	    	    	    	  
 	    	    	  </form-bean>

Here is what has been defined for valiator.xml

      <form name="gotoStep2Form">
            <field
                property="prospectNm"
                depends="required">
                    <arg0
key="gotoStep2.propNm.displayName"/>
             </field>
             <field
             	property="zipCd"
             	depends="required,mask">
             		<arg0 key="zipCd.displayName"/>
                     <var>
                       <var-name>mask</var-name>
                       <var-value>${zip}</var-value>
                     </var>
             </field>
             <field
             	property="stateCd"
             	depends="required">
             		<arg0 key="stateCd.displayName"/>
             </field>             
        </form>

When the use changes some of the information and say
does not provide a zip code, the validator kicks in
and 
send the user back to the page saying "zip code is
required".

PROBLEM:  The problem is it fails to draw the form
with the information.  basically no form in drawn.

WHAT I TRIED:  I put the beans in the session object,
now when it gives a validation error it finds to
information to redraw the page, but it basically zaps
all the information that was entered by the user.  I
have a feeling that putting the beans in the session
is not the way to go. 

TIA,

Samir


=====
-Samir Shah

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DynaValidatorForm data not repopulating

Posted by Samir Shah <sa...@yahoo.com>.
> Is absolutely nothing drawn or is the html form
> drawn but just the
> fields aren't filled back in with what the user
> selected? 
The HTML page gets drawn, but I get an error logged
that says
[1/3/03 11:00:02:000 CST] 7da25c48 WebGroup      X
Servlet Error: Cannot find bean prospect in any scope:
javax.servlet.jsp.JspException: Cannot find bean
prospect in any scope
	at quoteweb._step1_jsp_90._jspService(step1.jsp      
  :373)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:142)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:300)
	at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:430)
	at
org.apache.jasper.runtime.JspServlet.service(JspServlet.java:565)
	at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


> are you sure you
> are being forwarded to the correct page when the
> validation finds
> errors? Check that you have the correct page listed
> as the "input"
> page in your config file for that action. 
Here is what the config file says
	<action    path="/gotoStep2"
               type="com.fdl.quoteweb.GotoStep2Action"
               scope="request"
			   name="gotoStep2Form"                
               validate="true"
               input="/quoteweb/step1.jsp">
           <forward name="success"
path="/quoteweb/step2.jsp" />
           <forward name="failure"
path="/quoteweb/step1.jsp" />
	</action>

If the
> form is showing up
> but just not populated with the information then
> it's something
> different but figured I'd start with the obvious
> first.
> 
> -- 
> 
> Rick
> mailto:maillist@reumann.net
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


=====
-Samir Shah

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DynaValidatorForm data not repopulating

Posted by Rick Reumann <ma...@reumann.net>.
On Friday, January 3, 2003, 11:04:08 AM, Samir wrote:

SS> PROBLEM:  The problem is it fails to draw the form
SS> with the information.  basically no form in drawn.

Is absolutely nothing drawn or is the html form drawn but just the
fields aren't filled back in with what the user selected? Stupid
question I know (but sometimes it's the obvious).. are you sure you
are being forwarded to the correct page when the validation finds
errors? Check that you have the correct page listed as the "input"
page in your config file for that action. If the form is showing up
but just not populated with the information then it's something
different but figured I'd start with the obvious first.

-- 

Rick
mailto:maillist@reumann.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>