You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Jarrell <jj...@technovotics.com> on 2000/11/05 01:10:16 UTC

need a little help

I am starting to work with struts and just don't quite get it yet.

I am implementing a 2-3 page registration page.  The view is
reguser.jsp, and the appropriate page is displayed based upon a query
string.

I enter the registration by using   
	/app/reguser.jsp

I have the following in action.xml.
	  <!-- reguser stuff -->
  <action    path="/reguser"
      	actionClass="org.technovotics.reguserAction"
formAttribute="reguserForm"
        	formClass="org.technovotics.reguserForm">
 <forward name="success"    path="/index.jsp"/>   
</action>

I have copied the reguserAction and reguserAction largely from the
sample app.  BUT.... Everything falls through to the forward.  I have
even coded an always on error and it still falls through to the success.
Everything looks good, but I don't seem to get the validation errors.
Any ideas?

Thanks,
Jeff



Re: need a little help

Posted by Martin Cooper <ma...@tumbleweed.com>.
If I understand correctly, the problem is that you have a
ValidatingActionForm, but that you never see the behaviour you expect when
you enter invalid data. Is this right?

If so, the solution is to add an inputForm attribute to your action entry.
This is what tells struts which form bean to use if there are errors. My
guess is that you don't have that attribute because (like me, not so long
ago!) you copied it from the struts example. That appears to be a bug in the
example - as soon as I added an inputForm entry, everything worked.

--
Martin Cooper
Tumbleweed Communications

----- Original Message -----
From: "Jeff Jarrell" <jj...@technovotics.com>
To: <st...@jakarta.apache.org>
Sent: Saturday, November 04, 2000 4:10 PM
Subject: need a little help


> I am starting to work with struts and just don't quite get it yet.
>
> I am implementing a 2-3 page registration page.  The view is
> reguser.jsp, and the appropriate page is displayed based upon a query
> string.
>
> I enter the registration by using
> /app/reguser.jsp
>
> I have the following in action.xml.
>   <!-- reguser stuff -->
>   <action    path="/reguser"
>       actionClass="org.technovotics.reguserAction"
> formAttribute="reguserForm"
>         formClass="org.technovotics.reguserForm">
>  <forward name="success"    path="/index.jsp"/>
> </action>
>
> I have copied the reguserAction and reguserAction largely from the
> sample app.  BUT.... Everything falls through to the forward.  I have
> even coded an always on error and it still falls through to the success.
> Everything looks good, but I don't seem to get the validation errors.
> Any ideas?
>
> Thanks,
> Jeff
>
>