cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tom stuart <...@obsess.com>
Subject Re: Sessions & Cookies
Date Wed, 19 Apr 2000 15:43:20 GMT
On Wed, 19 Apr 2000, Laurent Eskenazi wrote:

> I am supposed to use the Java method response.encodeUrl() on every URL
> to add the session reference in this URL.
>
> My problem is that I don't know how to use some Java code in my XSL. How do
> people handle this problem ?

That's what XSP is for. Like JSP (Java Server Pages) to some extent, XSP
lets you use Java code in your XML and XSL. There's more information at:

	http://xml.apache.org/cocoon/xsp.html

To give you some idea of what it's all about, the example cited in the
documentation is:

---

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="sample.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
  <page title="Time of Day">
  
    <xsp:logic>
      // Define a variable to hold the time of day
      Date now = new Date();
    </xsp:logic>
  
    <p>
      To the best of my knowledge, it's now
      <!-- Substitute time of day here -->
      <xsp:expr>now</xsp:expr>
    </p>
  </page>
</xsp:page

---

XSP should be able to do what you need.

-Tom


Mime
View raw message