Phil Blake wrote:

    Ok, I think the proposal to do this is not going to go anywhere, but
    there is a solution. You'll probably need to give more info (or
    remind us of it) of what code you are calling this from (action,
    flow, generator, transformer, etc.).

    While you are at it, can you give more info about what part of the
    Cayenne API relies on this? It is odd that they need an http session
    object - what if you wanted to use this code outside of a webapp?


>From what I can see, cayenne is simply using the HttpSession as a key to associate with the database session.


In my case I am wanting to do something like this:

<xsp-session:set-attribute name="dataContext">
<xsp:expr>hookToCayenne().getDataContext(session)</xsp:expr>
</xsp-session:set-attribute>

However, this is where it goes south because session is not an HttpSession.

I like the suggestion that Session implements HttpSession - that looks like a fairly trivial change and is likely to support any framework that requires one.

No, this proposal has been vetoed (and discussed before and vetoed then too). See the dev archives for more info.


Any suggestions. This is currently a show-stopper so I need an answer - however, I am not a maintainer (yet) and I don't know how to go about having a change like this pushed through quickly. Do you have any advice?

Try this:
<xsp:logic>
javax.servlet.http.HttpSession realSession = null;
Object o = objectModel.get(org.apache.cocoon.environment.http.HttpEnvironment.HTTP_REQUEST_OBJECT);
if (o != null) {
javax.servlet.http.HttpServletRequest realRequest =
(javax.servlet.http.HttpServletRequest)o;
realSession = realRequest.getSession();
}
</xsp:logic>
<xsp-session:set-attribute name="dataContext">
<xsp:expr>hookToCayenne().getDataContext(realSession)</xsp:expr>
</xsp-session:set-attribute>


and let us know what happens.

Geoff


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to