You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bößem <ph...@boessem.de> on 2003/06/17 18:24:28 UTC

using xsp

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> 	

Does anyone know what i have done wrong.

thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


AW: using xsp

Posted by Bößem <ph...@boessem.de>.
Sorry for wasting your time.

I had one "}" to much. Sorry, but i thought if might be related to a
lack of xsp-knowledge

-----Ursprüngliche Nachricht-----
Von: Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com] 
Gesendet: Dienstag, 17. Juni 2003 18:51
An: cocoon-users@xml.apache.org
Betreff: Re: using xsp


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


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: using xsp

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
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