jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: [985-Session-lessResourceUrlEncoding] Discussion

From: Neil Griffin <neil.griffin_at_portletfaces.org>
Date: Tue, 20 Dec 2011 10:13:30 -0500

I had to develop a portlet bridge specific ResourceHandlerImpl too [1], but not for the same reason as Alexander. The main reason why I had to do this, is because I had to work around a servlet API assumption/dependency in the way resource URLs are constructed by Mojarra and MyFaces. I'll have more time to discuss this (and other portlet bridge issues) in January.

@Alexander: If there is a JSF resource that skips a call to ExternalContext#encodeResourceURL(String) then would that technically be a bug in the component/application that the bridge is trying to work around?

Regarding adding the sessionId, that seems like it should be the responsibility of the portlet container to perform in MimeResponse#createResourceURL(), because the Portlet 2.0 API doesn't provide access to the underlying HttpServletResponse.

[1] http://svn.portletfaces.org/svn/portletfaces/bridge/portletfaces-bridge-impl/trunk/src/main/java/org/portletfaces/bridge/application/ResourceHandlerImpl.java

On Dec 19, 2011, at 6:01 PM, Alexander Smirnov wrote:

> There was a problem with JSF resources that skip call to ExternalContext#encodeResourceUrl. To deal with that, I had to create a solution that I don't like - wrap ResourceHandler with portlet-specific implementation that wraps all resources with portlet-specific wrapper that explicitly call #encodeResourceUrl. That was a problem if Resource did also call this method.
> In the old richfaces library, we solver this problem by special 'requiresSession' flag in Resource that tells framework whether it has to call HttpServletResponse#encodeUrl.
>
>
> On Mon, Dec 19, 2011 at 2:35 PM, Edward Burns <edward.burns_at_oracle.com> wrote:
> >>>>> On Fri, 16 Dec 2011 16:43:35 -0500, Neil Griffin <neil.griffin_at_portletfaces.org> said:
>
> NG> I haven't run into any problems with sessionId encoding with
> NG> PortletFaces Bridge with Liferay Portal or Pluto.
>
> NG> The Portlet 2.0 API doesn't provide access to
> NG> HttpServletResponse. Instead, the
> NG> ExternalContext#encodeResourceURL(String) method should be calling
> NG> javax.porlet.MimeResponse#createResourceURL() [1]
>
> NG> [1] http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/MimeResponse.html#createResourceURL()
>
> Ok, so is it safe to say, from your perspective, Neil, that
> [985-Session-LessResourceUrlEncoding] is not necessary and can be closed
> as WONTFIX?
>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | homepage: | http://ridingthecrest.com/
>
>
>
> --
> _________________
> entia non sunt multiplicanda praeter necessitatem,
> (entities should not be multiplied beyond necessity.)