cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Jenkins" <digitalman200...@hotmail.com>
Subject Re: Having a function in a XSP.
Date Fri, 22 Feb 2002 03:15:18 GMT
You can put an inner class inside an xsp:logic tag if it appears before your 
main element, i.e. <page>.

I did this at first.  But when I needed the inner class again in another 
page, I moved it out of the pages and put it in a separate .java file and 
made sure the resulting .class file was on the classpath.

Ed

---

From: Mauricio Souza Lima <mauriciosl@terra.com.br>
Reply-To: cocoon-users@xml.apache.org
To: cocoon-users@xml.apache.org
Subject: Re: Having a function in a XSP.
Date: Wed, 20 Feb 2002 14:31:55 -0200

Ed Jenkins wrote:

><snip/>
>
>  > Can I create an inner class with methods inside a XSP?
>
>Don't think so. All XSP code goes in the resulting Generator's generate()
>method. What you should do IMHO is to use helper classes.


All xsp:logic tags before the main tag (the first tag after xsp:page,
like <page>), are put before de generate() method, so, i think you can
do it.
But if you want to work with some custom classes inside the xsp, i think
that a better pratice, is to create the class outside the xsp page, put
it in the WEB-INF/lib on a jar file and them import it inside the xsp page.

>
>For more information on taglibs, I suggest you to look at the cocoon
>builtin
>taglibs in the sourcecode.
>
>--
>Nicola Ken Barozzi                 krysalis.org@nicolaken.com
>             - verba volant, scripta manent -
>    (discussions get forgotten, just code remains)
>---------------------------------------------------------------------
>
Regards...

Mauricio Souza Lima
Rational Consulting
mauriciosl@terra.com.br
Rua Helena, 140 / cj. 82
São Paulo - SP - Brazil
Fone / Direct: +55 11 3842-7138


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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





_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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