dcsimg
1.1 Validator Questions
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Scott_Steimle
Posted On:   Monday, August 19, 2002 02:37 PM

1) The sample validator application that comes with 1.1 b2 works, but validation in my application does not. If I define the appropriate rules in validation.xml and change my base form class to extend ValidatorActionForm, what should I expect to happen, for instance, when I don't provide a required field? (I have not set validate=false for any action. Although I haven't implemented displaying ActionErrors in my view yet, I would have expected the controller to not forward like it used to.) 2) I am trying to implement the Validator of Struts 1.1 b2 by using the ValidatorActionForm class as my base Action. It is my understanding that using this class somehow allows the ability to selectivly validate form properties based on the particular act   More>>

1) The sample validator application that comes with 1.1 b2 works, but validation in my application does not. If I define the appropriate rules in validation.xml and change my base form class to extend ValidatorActionForm, what should I expect to happen, for instance, when I don't provide a required field? (I have not set validate=false for any action. Although I haven't implemented displaying ActionErrors in my view yet, I would have expected the controller to not forward like it used to.)


2) I am trying to implement the Validator of Struts 1.1 b2 by using the ValidatorActionForm class as my base Action. It is my understanding that using this class somehow allows the ability to selectivly validate form properties based on the particular action being invoked (by using the action's path). How?


3) How do I turn on the commons logging that comes with Struts?

   <<Less

Re: 1.1 Validator Questions

Posted By:   Anonymous  
Posted On:   Tuesday, August 20, 2002 07:26 AM

The sample uses ValidatorForm which causes the validator to use the request scope or session scope name of the form bean as the key for the entries in validation.xml.

ValidatorActionForm causes the validator to use the action elements path attribute (from struts-config.xml) as the key. If you use ValidatorActionForm you need to make sure the name attribute of the appropriate form element in validation.xml matches the path attribute of the your action element in struts-config.xml.

For logging I use Log4J which you have to download and install separately. commons-logging also has a class called SimpleLog which writes to stderr. See the Javadocs for SimpleLog for info on how to set the logging levels etc.

About | Sitemap | Contact