You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kamholz, Keith (corp-staff) USX" <kk...@moog.com> on 2003/06/20 18:25:35 UTC
Validator
Hey,
I'm trying to put validation into my application using the validator plugin.
However it doesn't seem like it's doing anything at all. I know it's a very
general question, but what are some things I should look for? Are there any
common mistakes in setting up that I should check for?
I'm not sure if it's a related issue or not, but I have to specify the name
attribute for each field of my forms. You're not supposed to have to
specify the name right? What do you think I did wrong?
Thanks in advance.
- Keith
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
DefinitionDispatcherAction question
Posted by Mykola Ostapchuk <my...@sympatico.ca>.
Hello,
I'm trying to access "home.Page" in tiles definitions using
DefinitionDispatcherAction.
I call <myapp>/home.do from browser and receive the next error:
"Definition dispatcher action : can't get parameter 'home.Page'."
What am I doing wrong?
struts-config.xml:
<action path="/home"
type="org.apache.struts.tiles.actions.DefinitionDispatcherAction"
parameter="home.Page">
<forward name="success" path="anything"/>
<forward name="error" path="path.to.error.page"/>
</action>
tiles-defs.xml:
<definition name="home.Page" path="/layouts/classicLayout.jsp">
<put name="title" value="WOS - Home page" />
<put name="header" value="/header.jsp" />
<put name="footer" value="/footer.jsp" />
<put name="menu" value="/menuBody.jsp" />
</definition>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Validator
Posted by Sergey Smirnov <si...@exadel.com>.
Common mistake is: You forgot something or misspelt something. Week ago I
sent condition set you need to satisfy to make common validator working. It
is bellow.
For example, we have a very simple jsp form and
want to use standard server-side validator 'required' for one form field.
Actually, it might vary, but to do so you have:
1) Resource (.properties) file with keys/values for standard validators (at
least - errors.required)
2) struts-config file should contain the reference to this resource file for
message-resources node
3) struts-config plug-in node should contain
className="org.apache.struts.validator.ValidatorPlugIn"
4) this plugin should have set-property with name pathnames that corresponds
to validator files (such as /WEB-INF/validator-rules.xml and
/WEB-INF/validation.xml)
5) validation.xml should contain form with name corresponds to form-bean
name
6) the form should have a field with property that corresponds to field name
we want to validate
7) this field should have a 'depends' attribute that corresponds to
validator name mentioned in /WEB-INF/validator-rules.xml (in our case - with
name 'required')
8) this field should have an arg0 node which attribute key corresponds to
existing key in resource file
9) form bean should inherit org.apache.struts.validator.ValidatorForm class
10) form bean validate should call validate method of super class
11) 'input' attribute of action should reference to jsp page with validated
form
12) jsp page should contains <html:errors /> (or its substitute)
Regards,
Sergey Smirnov
-----------------------------------------
Exadel Struts Studio - IDE for Struts
http://www.exadel.com/strutsStudio
-----------------------------------------
----- Original Message -----
From: "Kamholz, Keith (corp-staff) USX" <kk...@moog.com>
To: "Struts (E-mail)" <st...@jakarta.apache.org>
Sent: Friday, June 20, 2003 9:25 AM
Subject: Validator
> Hey,
> I'm trying to put validation into my application using the validator
plugin.
> However it doesn't seem like it's doing anything at all. I know it's a
very
> general question, but what are some things I should look for? Are there
any
> common mistakes in setting up that I should check for?
>
> I'm not sure if it's a related issue or not, but I have to specify the
name
> attribute for each field of my forms. You're not supposed to have to
> specify the name right? What do you think I did wrong?
>
> Thanks in advance.
>
>
> - Keith
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org