B��em dijo:
> hi,
>
> i am quite unexperienced within cocoon, espacially when it comes to the
> use of java within xsp documents.
>
> anyway, i am trying to do - in the fist step - a simple email
> validation. To test if and how xsp documents have to structured i wrote
> a simle code, to check if it works.
>
> Unfortunatly it doesn't
>
> the xsp code is the following:
>
> <xsp:structure>
> <xsp:include>java.util.regex.Matcher</xsp:include>
> <xsp:include>java.util.regex.Pattern</xsp:include>
> </xsp:structure>
>
> <page>
> <xsp:logic>
> String msg = "";
> String input = "[EMAIL PROTECTED]" ;
> Pattern pattern = Pattern.compile("@");
> Matcher matcher = pattern.matcher( input );
>
> if (matcher.find()) {
> msg = "valide email";
> }
> else {
> msg = "not valid";
>
> }
> }
> </xsp:logic>
> <xsp:expr>msg</xsp:expr>
To the last line add some HTML tags, for esample if you wish to see the
result, add something like:
<p>
<xsp:expr>msg</xsp:expr>
</p>
Also FYI, instead of write your own valitation, check the FormValidator
Action.
A very nice source of info is http://wiki.cocoondev.org/
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]