I'm trying to patch the VelocityViewServlet so that the same context is
used for multiple includes/forwards during a single request.  However, I
seem to be thwarted by some unknown and malevolent force :-)

My first thought is to simply save the ChainedContext in the request
attributes and extract for subsequent requests in
VelocityViewServlet.createContext(), like this:

        ChainedContext ctx;
        
        if (persistentContextKey == null)
        {
                ctx = new ChainedContext( null, request, response,
getServletContext() );
        }
        else
        {
                ctx = (ChainedContext)request.getAttribute(
persistentContextKey );
                
                if (ctx == null)
                {
                        ctx = new ChainedContext( null, request,
response, getServletContext() );
                        request.setAttribute( persistentContextKey, ctx
);
                }
        }

However, this doesn't work, for reasons which apparently require more
understanding of Velocity architecture than I possess.  I can understand
some undesirable behavior here because the request and response objects
might have been substituted at the second invocation, but in my example
that isn't the case.  And without any way of extracting the Map out of
the context, there doesn't seem to be much I can do about it.

Can anyone shed any light on the problem?

Please CC me on any responses, I only read the -dev list out of the
archives, which trail the list by a couple days.

Thanks,
Jeff



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

Reply via email to