cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: using xsp
Date Tue, 17 Jun 2003 16:50:39 GMT
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 = "philipp@boessem.de" ;
>     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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message