See below

> -----Original Message-----
> From: Jan-Peter Hagenmueller [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 08, 2003 9:21 AM
> To: [EMAIL PROTECTED]
> Subject: Spam:[OS-webwork] Webwork2: VALIDATION
> 
> 
> Hi!
> 
> i've got some questions hoping you can give me some short advices:
> 
>  - must i use webwork tags for <form...>,<textfield...> etc. 
> to make field-validation work?

Nope

>    
>    if yes:
>      - why is there always a <table></table> surrounding the 
> <ww:form...> in resulting code?

Check out the templates for the UI components... They have a header and
footer template which show the field errors above the form field using a
table layout. 

>      - why do i must like labelling my inputs (<ww:textfield 
> label=... />) can i customize it?
>      - what is the right quotation: name=' " xxx " ' or 
> name=' " xxx ' " or just label= " ' xxx ' " (documentations differ...)
>        seems that ' " xxx " ' is the only right quotation ... ?

It's label="'xxx'"... The single quotes tell it that it's not a variable
to be looked up...

> 
> 
>  - i got a xxx-validation.xml with each action class
>    - am i right with: at the level of xxxAction.class file in 
> the war's classes directory?

Yes, it needs to be in the same package.

> 
> 
>  - do i have to handle field errors in execute() method like:
>        if(!getActionErrors().isEmpty() || 
> !getFieldErrors().isEmpty()) {
>             return INPUT;
>         } return SUCCESS;
>    or is "succes" or "input" automatically returnd and mapped 
> to action's configuration in xwork.xml (i found no docs about it)

If you apply the default workflow interceptor it will automatically
return "input" for you if there are any errors (action or field) in the
Action. 

> 
>  - i got xwork.xml configuration for actions like :
> 
>    <action name="loginAction" class="ehp.user.action.LoginAction">
>         <interceptor-ref name="validationWorkflowStack"/>
>         <result name="success" type="dispatcher">
>             <param name="location">/ehp/right.html</param>
>         </result>
>         <result name="input" type="dispatcher">
>             <param name="location">/ehp/false.html</param>
>         </result>
>         <result name="error" type="dispatcher">
>             <param name="location">/ehp/false.html</param>
>         </result>
>    </action>

This looks ok... You can simplify a bit if you remove the <param>
elements and just put the path to the HTML directly as the body of the
<result> element, like this:

<result name="error" type="dispatcher">/ehp/false.html</result>

> 
>  - i got validators.xml in the war's WEB-INF root like in 
> documentations:

This needs to be in the WEB-INF/classes so it's in the classpath

> 
>   <validators>
>     <validator name="required" 
> class="com.opensymphony.xwork.validator.validators.RequiredFie
> ldValidator"/>
>     <validator name="requiredstring" 
> class="com.opensymphony.xwork.validator.validators.RequiredStr
> ingValidator"/>
>     <validator name="int" 
> class="com.opensymphony.xwork.validator.validators.IntRangeFie
> ldValidator"/>
>     <validator name="date" 
> class="com.opensymphony.xwork.validator.validators.DateRangeFi
> eldValidator"/>
>     <validator name="expression" 
> class="com.opensymphony.xwork.validator.validators.ExpressionV
> alidator"/>
>     <validator name="fieldexpression" 
> class="com.opensymphony.xwork.validator.validators.FieldExpres
> sionValidator"/>
>     <validator name="email" 
> class="com.opensymphony.xwork.validator.validators.EmailValidator"/>
>     <validator name="url" 
> class="com.opensymphony.xwork.validator.validators.URLValidator"/>
>     <validator name="visitor" 
> class="com.opensymphony.xwork.validator.validators.VisitorFiel
> dValidator"/>
>   </validators>
> 
> Why doesn't it work for me ? :-(

What does it say?

> 
> thanks a lot
> 
> jp
> 

Jason


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to