That's XSP trap #1. <xsp:logic> inside <xsp:page> generates code in
class scope rather than in method scope.
<xsp:page>
<xsp:logic>
Date adate = new Date();
</xsp:logic>
<page>
<xsp:logic>
Date bdate = new Date();
</xsp:logic>
<adate><xsp:expr>adate</xsp:expr></adate>
<bdate><xsp:expr>bdate</xsp:expr></bdate>
</page>
</xsp:page>
Is something like
Class MyXSP extends XSP {
Date adate = new Date();
void generate() {
print "<page>";
Date bdate = new Date();
print "<adate>", adate, "</adate>";
print "<bdate>", bdate, "</bdate>";
print "</page>";
}
}
Combined with Cocoon's component pooling adate will stay at the time the
page was call first while bdate changes for each update.
HTH, Alfred.
-----Original Message-----
From: jantje [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 12. September 2006 16:13
To: [email protected]
Subject: Re: Passing parameter from sitemap to .xsp - everything failes
- help ne
Hi, after really trying everything, i have found this:
<?xml version="1.0"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:util="http://apache.org/xsp/util/2.0">
<page>
<xsp:logic>
int newUserInt = (int)<util:get-sitemap-parameter
name="newUser"/>.length();
String newUserString =
(String)<util:get-sitemap-parameter
name="newUser"/>;
</xsp:logic>
<xsp:expr><util:get-sitemap-parameter
name="newUser"/></xsp:expr>
</page>
</xsp:page>
And it works!!!
Ok, fine for me, but is there someone who knows the solution for the
problem
i had? it would be nice to know the solution :-)
Thanks for your time,
me.
This message is for the named person's use only. It may contain confidential,
proprietary or legally privileged information. No confidentiality or privilege
is waived or lost by any mistransmission. If you receive this message in error,
please notify the sender urgently and then immediately delete the message and
any copies of it from your system. Please also immediately destroy any
hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended
recipient. The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this message are
those of the individual sender, except where the message states otherwise and
the sender is authorised to state them to be the views of the sender's company.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]