Hi Roberto,
> So... have you got an idea about my
> velocity context mixture?
>
> Why the BridgesVelocityViewServlet is merging contexts?
> Maybe the merging can cause naming collision?
>
> Can't I put different objects with the same context name
> inside a portlet?
> How can I find who is garbaging my portlet velocity
> context?
I think it is simply because portlet objects should be accessible from vm
templates.
GenericVelocityPortlet stores some additional objects such as renderRequest,
renderResponse and portletConfig into a temporary context object.
(In addition, I'm seeing that your portlet is also storing objects into this by
using getContext().)
The BridgesVelocityViewServlet retrieves the temporary context object and puts
its objects into the real velocity context object.
Because the real velocity context object is created by the VelocityViewServlet
on every dispatch, I don't think the velocity context object could be shared
among multiple dispatches.
However I can guess two possible problems:
(1) As I mentioned before, objects with same names were stored into request or
session attributes. So, the velocity context did fallback retrieval.
(2) The current getContext() method of GenericVelocityPortlet is using a
special request attribute to store/retrieve the temporary context object by the
name defined in GenericVelocityPortlet.java like the following:
public final static String PORTLET_BRIDGE_CONTEXT =
"portals.bridges.velocity.context";
So, when a temporary context object is created in the portlet, it is stored in
the request attributes via 'renderRequest'. I'm not sure, but there's a
problematic possibility here: what if the invocation,
'renderRequest.getAttribute(PORTLET_BRIDGE_CONTEXT)' returns other unexpected
context object which was set in other portlet in the same psml request?
If you are suspicious on this, I'd like to suggest you override getContext()
method in your portlet and see if it has that kind of problem. (Probably you
can use renderRequest's hash code for investigation purpose.) [1]
Regards,
Woonsan
[1]
http://svn.eu.apache.org/repos/asf/portals/bridges/tags/1.0.4/velocity/src/java/org/apache/portals/bridges/velocity/GenericVelocityPortlet.java
>
> Thank you for your interest Woonsan.
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]