You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Merrilees <da...@fenc.org.uk> on 2004/08/23 12:33:16 UTC

RE: Global variables - Email has different SMTP TO: and MIME TO: fields in the email addresses

Is it possible to access session variables in the sitemap?

David Merrilees
 

-----Original Message-----
From: robby.pelssers@vodafone.com [mailto:robby.pelssers@vodafone.com] 
Sent: 23 August 2004 11:27
To: users@cocoon.apache.org
Subject: RE: Global variables - Email has different SMTP TO: and MIME
TO: fields in the email addresses

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@B
otto
m> 


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




This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. FENC, Hamlin Way, Hardwick Narrows, King's Lynn, UK, or see our website www.fenc.org.uk


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


Re: Global variables - Email has different SMTP TO: and MIME TO: fields in the email addresses

Posted by vjaulin <vi...@ajlsm.com>.
David Merrilees a écrit :

>Is it possible to access session variables in the sitemap?
>
>David Merrilees
> 
>  
>
<map:match pattern="test">
    <map:generate src="{session-attr:varname}"/>
    <map:serialize/>
</map:match>

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