Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts validation before form is displayed

Reply
Thread Tools

Struts validation before form is displayed

 
 
Jack
Guest
Posts: n/a
 
      07-19-2005
Hello,
I'm currently having a problem with the Struts validator.
I have a very simple Struts bean "EditionPersonneForm" (extending
ValidatorForm) associated with an action "EditerPersonneAction" and a
JSP form "EditerPersonne.jsp"

[From struts-config.xml]
<action path="/EditionPersonne"

type="com.myproject.actions.EditerPersonneAction"
scope="session" name="EditerPersonneForm"
input="/pages/EditerPersonne.jsp"
parameter="do"
validate="true">
<forward name="afficherEditionPersonne"
path="/pages/EditionPersonne.jsp"/>
<forward name="afficherAjoutPersonne"
path="/pages/AjoutPersonne.jsp" />
</action>
[end of listing]

The matter is that the method validate() is called BEFORE the form is
displayed. So if the Struts bean is filled in with wrong values at this

very moment, the validator causes an error and Struts redirects me to
the "input" error page, and the action (which populates the form
with the right data) is never called !
I have another quite alike project where the validate is not called
before the JSP (to me it should be the normal behaviour), so I guess
this is a simple problem of configuration, but I just was not able to
find it.
Does anyone have a clue ?
Thanks in advance,
Olivier

 
Reply With Quote
 
 
 
 
Billy
Guest
Posts: n/a
 
      07-19-2005
Hi again
More details:
My problem seems to be related to the Struts Tiles (the main difference
between my project and the example is that one do use the Tiles plugin
while the other don't). I still can't figure out what's wrong (for I
didn't have the time to understand the Tiles very well yet, my new
project is a copy from the basic struts-blank). Am I right ? I am still
trying, but a little help would be welcome.
Cheers
Olivier

 
Reply With Quote
 
 
 
 
Wendy Smoak
Guest
Posts: n/a
 
      07-19-2005
"Billy" <> wrote

> My problem seems to be related to the Struts Tiles (the main difference
> between my project and the example is that one do use the Tiles plugin
> while the other don't). I still can't figure out what's wrong (for I
> didn't have the time to understand the Tiles very well yet, my new
> project is a copy from the basic struts-blank). Am I right ? I am still
> trying, but a little help would be welcome.


The quickest way to get help is to post on the Struts Users mailing list:
http://struts.apache.org/mail.html

--
Wendy Smoak


 
Reply With Quote
 
Ramza Brown
Guest
Posts: n/a
 
      07-19-2005
Jack wrote:
> Hello,
> I'm currently having a problem with the Struts validator.
> I have a very simple Struts bean "EditionPersonneForm" (extending
> ValidatorForm) associated with an action "EditerPersonneAction" and a
> JSP form "EditerPersonne.jsp"
>
> [From struts-config.xml]
> <action path="/EditionPersonne"
>
> type="com.myproject.actions.EditerPersonneAction"
> scope="session" name="EditerPersonneForm"
> input="/pages/EditerPersonne.jsp"
> parameter="do"
> validate="true">
> <forward name="afficherEditionPersonne"
> path="/pages/EditionPersonne.jsp"/>
> <forward name="afficherAjoutPersonne"
> path="/pages/AjoutPersonne.jsp" />
> </action>
> [end of listing]
>
> The matter is that the method validate() is called BEFORE the form is
> displayed. So if the Struts bean is filled in with wrong values at this
>
> very moment, the validator causes an error and Struts redirects me to
> the "input" error page, and the action (which populates the form
> with the right data) is never called !
> I have another quite alike project where the validate is not called
> before the JSP (to me it should be the normal behaviour), so I guess
> this is a simple problem of configuration, but I just was not able to
> find it.
> Does anyone have a clue ?
> Thanks in advance,
> Olivier
>


This is interesting.

 
Reply With Quote
 
Billy
Guest
Posts: n/a
 
      07-20-2005
Thank you Wendy for the good tip !

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000 boney Java 1 12-15-2006 02:24 PM
Trouble with Struts - validation before form is displayed olivier Java 0 07-19-2005 09:34 AM
Struts Validation Framework: suppressing startup output from validation.xml javadude Java 0 02-16-2005 05:37 PM
Struts validation for combine form fields validation Sumith Mathur Java 0 09-23-2004 06:26 PM
Form Validation Problem...Persisiting form fields on validation failure. bnp Javascript 4 05-12-2004 12:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57