cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kerstin Kohl <kk...@gmx.de>
Subject Re: Re: global variable via taglib in XSP
Date Sat, 12 May 2001 09:25:10 GMT
<<Kerstin,

<<what do you mean by a "global variable" in this case?  

So what I mean is this:

e.g.

<xsp:page......>

<xsp:structure......>
<xsp:logic>
                Connection con = new Connection();        // this will be an
object that creates for each session a connection to a database (global
variable because it can be used between the user root tags)

                static Connection con2 = new Connection();        // this
will be an object that creates for all sessions the same connection to a
database (global variable because it can be used between the user root tags)

</xsp:logic>

<page>
<xsp:logic>
                  Connection con3 = new Connection();    // this will also
create a database connection but within the next logic tags it won't be
useable!

                  con.getState(); // no problem
                  con2.getState(); // no problem
                  con3.getState(); // no problem
    
</xsp:logic>

<xsp:logic>

                  con.getState(); // no problem
                  con2.getState(); // no problem
                  con3.getState(); // big problem
    
</xsp:logic>

</page>
</xsp:page>

Am I wrong?

If not how to create e.g. the object con via a selfdefined taglib!


<<I don't think there
<<are any such things as global variables in Cocoon, certainly not in
<<XML/XSL.  You can create static class variables in Java, which act much
<<like global variables.
<<
<<-Christopher




Please respond to cocoon-users@xml.apache.org

To:   cocoon-users@xml.apache.org
cc:

Subject:  global variable via taglib in XSP


Hi ,

who knows how to create a global variable via a taglib?
1. How to create a variable
2. the position of the tag. I realized that it's not possible to place a
tag
before the user root, is this right?

Kerstin





-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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