cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paint...@mc.duke.edu
Subject Re: ESQL, sessions, and debugging
Date Thu, 17 May 2001 21:31:05 GMT

Jason,

yes, I'm having trouble with session in this usage, also.  The main problem
appears to be that getAttribute returns an object, and there is no easy way
to force it to be a String without writing Java.  You were using the "as"
attribute in yours, I think, trying to do 'as="string"'.  Looking in the
session logicsheet, however, the acceptable values for as are "object" and
"node".  It isn't a casting mechanism, merely a way to determine whether
you get back a Java object or an XML node, I guess.

Anyway, I was able to make it work by doing a Java cast in front of the
<session:get-attribute ...> tag, but of course I had to put it inside an
<xsp:logic> element to make it work.

Your code would become:
uw_userid =
  <esql:parameter type="string">
    <xsp:logic>(String)</xsp:logic>
    <session:get-attribute name="uwid" default="jafoster"/>
  </esql:parameter>

This is clearly awkward.  It would seem that there are some easy changes we
could make to the session taglib to improve this situation.  Since Strings
are such likely things to store in the Session, perhaps it would make sense
to have a session:get-string tag specifically for this purpose.
Alternately, the session:get-attribute tag could have an optional "type"
attribute, so we could do casts without having to put in an <xsp:logic>
element:

  <session:get-attribute name="user" type="String"/>

Any thoughts, anyone?

-Christopher




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

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

Subject:  Re: ESQL, sessions, and debugging


> what version of everything are you using?  I am using the
> <request:get-parameter ...> mechanism inside <esql:parameter> tags very
> successfully with Cocoon 1.8.2.  Also, are you sure you have the correct
> URI's for the session and request taglibs?  I have this for the request
> taglib (very different from yours, below):
>      xmlns:request="http://www.apache.org/1999/XSP/Request"

I'll check shortly.  I've seen a couple of different namespaces, and I'm
using Cocoon2 (which I should have mentioned).  The one I chose was based
on looking at the source of the xsl that transforms the tags.

As things stand now I can use request parameters as I would like, but I
can't use session attributes.  Can you check if that works on your system?

Thanks for the reply.

Jason Foster





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