cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robby.pelss...@vodafone.com
Subject RE: Global variables
Date Mon, 23 Aug 2004 12:37:06 GMT
You could mail an example of your code...
 
But i suppose by using the full classname in that case...
 
like for instance if you use both  java.util.Date and java.sql.Date  in your
xsp
 
Then you will need to declare your variables like
 
java.util.Date mydate = new java.util.Date();
 
 

-----Original Message-----
From: Adriano Smith [mailto:orosmith@sify.com]
Sent: 23 August, 2004 14:57
To: users@cocoon.apache.org
Subject: RE: Global variables


How is it possible to differentiate between javamail session and cocoon
environment session inside the same XSP ?



Error is seen when i try to use both

Type mismatch: cannot convert from org.apache.cocoon.environment.Session to
javax.mail.Session\"





Quoting  robby.pelssers@vodafone.com:



> Here is an example of a global variable \'title\'

> <xsp:page 
>   language=\"java\" 

>   xmlns:xsp=\"  <http://apache.org/xsp> http://apache.org/xsp\">

>  

>   <xsp:structure>

>     <xsp:include>java.sql.*</xsp:include>

>     <xsp:include>java.text.*</xsp:include>

>     <xsp:include>java.util.*</xsp:include>

>   </xsp:structure>

>   

>   <svgmenu width=\"50\">

>     <title><xsp:expr>title</xsp:expr></title>

>   </svgmenu>

>  

>   <xsp:logic>

>     private String title = \"Here comes title \";   

>   </xsp:logic>

> </xsp:page>

>  

>  

> To use objects declared in other xsp, you can make use of 

>  

>     <xsp:include>org.apache.cocoon.environment.Request</xsp:include>

>     <xsp:include>org.apache.cocoon.environment.Session</xsp:include>

>  

> in xsp where you declare object/variable

>               Session session = request.getSession();

>               session.setAttribute(\"mytitle\", title);

>  

> in xsp where you want to use object/variable

>           Session session = request.getSession();

>           String title  = (String)session.getAttribute(\"mytitle\");

>           session.removeAttribute(\"mytitle\");

> 

> -----Original Message-----

> From: Adriano Smith [mailto:orosmith@sify.com]

> Sent: 23 August, 2004 12:42

> To: users@cocoon.apache.org

> Subject: Global variables

> 

> 

> How can global variables be declared in xsp?

> 

> Also how can objects declared in one xsp be accessed in another?

> 

> 

>  

>
<http://ads.sify.com/RealMedia/ads/click_nx.ads/mail.sify.com/sentmail@Botto
> m> 

> 

> 

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org

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

> 

> 
 
<http://ads.sify.com/RealMedia/ads/click_nx.ads/mail.sify.com/sentmail@Botto
m>  


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


Mime
View raw message