RE: Spam:[OS-webwork] Webwork2: VALIDATION

2003-12-08 Thread Jason Carreira
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 , etc. 
> to make field-validation work?

Nope

>
>if yes:
>  - why is there always a  surrounding the 
>  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 ( 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 :
> 
>
> 
> 
> /ehp/right.html
> 
> 
> /ehp/false.html
> 
> 
> /ehp/false.html
> 
>

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

/ehp/false.html

> 
>  - 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

> 
>   
>  class="com.opensymphony.xwork.validator.validators.RequiredFie
> ldValidator"/>
>  class="com.opensymphony.xwork.validator.validators.RequiredStr
> ingValidator"/>
>  class="com.opensymphony.xwork.validator.validators.IntRangeFie
> ldValidator"/>
>  class="com.opensymphony.xwork.validator.validators.DateRangeFi
> eldValidator"/>
>  class="com.opensymphony.xwork.validator.validators.ExpressionV
> alidator"/>
>  class="com.opensymphony.xwork.validator.validators.FieldExpres
> sionValidator"/>
>  class="com.opensymphony.xwork.validator.validators.EmailValidator"/>
>  class="com.opensymphony.xwork.validator.validators.URLValidator"/>
>  class="com.opensymphony.xwork.validator.validators.VisitorFiel
> dValidator"/>
>   
> 
> 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


[OS-webwork] Webwork2: VALIDATION

2003-12-08 Thread Jan-Peter Hagenmueller
Hi!

i've got some questions hoping you can give me some short advices:

 - must i use webwork tags for , etc. to make field-validation 
work?
   
   if yes:
 - why is there always a  surrounding the  in resulting 
code?
 - why do i must like labelling my inputs () 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 ... ?


 - 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?


 - 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)

 - i got xwork.xml configuration for actions like :

   


/ehp/right.html


/ehp/false.html


/ehp/false.html

   

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

  









  

Why doesn't it work for me ? :-(

thanks a lot

jp




---
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