You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by James Nguyen <se...@duskyblue.net> on 2003/10/17 18:06:24 UTC

Re: [Patch] PortletRequestDispatcherImpl doesn't unwrap requests

Stefan/Andy,

I will try the patch out later today and let you know how it turns out.

Thanks for the information.

James

At 05:13 PM 10/17/2003 +0200, you wrote:
>Thanks Andy.
>
>I'm +1 for accepting the change.
>
>Stefan
>
>Andy Pruitt wrote:
>
>>This is a patch for the core pluto engine.
>>
>>CURRENT BEHAVIOR:
>>[PortletRequestDispatcherImpl:80]  InternalPortletRequest
>>internalRequest = (InternalPortletRequest)request;
>>PROPOSED CHANGE:
>>replace with:
>>InternalPortletRequest internalRequest =
>>CoreUtils.getInternalRequest(request);
>>RATIONALE
>>This is the only location in the codebase which relies on a
>>(InternalPortletRequest) cast instead of using
>>CoreRequestUtils.getInternalRequest(..).
>>Currently, PortletRequestDispatcherImpl assumes that any PortletRequest
>>it receives will be an instance of InternalPortletRequest.  This becomes
>>a problem if a portal implementer needs to wrap the request using
>>PortletRequestWrapper; the cast will fail.
>>Other alternatives would be:
>>         * Remove CoreUtils.getInternalRequest(..), and use a
>>(InternalPortletRequest) cast on the assumption that all PortletRequests
>>implement InternalPortletRequest.
>>         * Have PortletRequestWrapper and subclasses implement
>>InternalPortletRequest.
>>         * No change.
>>
>>If no change, portal implementers should subclass
>>PortletRequestWrapper+, which seems a shame since it would mean
>>PortletRequestWrapper+ could never be safely used without subclassing.
>>(Subclassing like :
>>     class InternalRenderWrapper extends RenderRequestWrapper implements
>>InternalPortletRequest {
>>         public InternalRenderWrapper(RenderRequest renderRequest) {
>>             super(renderRequest);
>>         }
>>         public void lateInit(HttpServletRequest webModuleServletRequest)
>>{
>>
>>CoreUtils.getInternalRequest(getRenderRequest()).lateInit(webModuleServl
>>etRequest);
>>         }
>>         public PortletWindow getInternalPortletWindow() {
>>             return
>>CoreUtils.getInternalRequest(getRenderRequest()).getInternalPortletWindo
>>w();
>>         }
>>         public void setIncluded(boolean included) {
>>
>>CoreUtils.getInternalRequest(getRenderRequest()).setIncluded(included);
>>         }
>>         public boolean isIncluded() {
>>             return
>>CoreUtils.getInternalRequest(getRenderRequest()).isIncluded();
>>         }
>>     }
>>
>


James Nguyen
I/T Professional
600 Anton Boulevard - Suite 360
Costa Mesa, California 92626

"Cogito ergo sum"
         -Rene Descartes



Re: [Patch] PortletRequestDispatcherImpl doesn't unwrap requests

Posted by James Nguyen <se...@duskyblue.net>.
Sorry.

I replied to the wrong thread.

James

At 09:06 AM 10/17/2003 -0700, you wrote:
>Stefan/Andy,
>
>I will try the patch out later today and let you know how it turns out.
>
>Thanks for the information.
>
>James
>
>At 05:13 PM 10/17/2003 +0200, you wrote:
>>Thanks Andy.
>>
>>I'm +1 for accepting the change.
>>
>>Stefan
>>
>>Andy Pruitt wrote:
>>
>>>This is a patch for the core pluto engine.
>>>
>>>CURRENT BEHAVIOR:
>>>[PortletRequestDispatcherImpl:80]  InternalPortletRequest
>>>internalRequest = (InternalPortletRequest)request;
>>>PROPOSED CHANGE:
>>>replace with:
>>>InternalPortletRequest internalRequest =
>>>CoreUtils.getInternalRequest(request);
>>>RATIONALE
>>>This is the only location in the codebase which relies on a
>>>(InternalPortletRequest) cast instead of using
>>>CoreRequestUtils.getInternalRequest(..).
>>>Currently, PortletRequestDispatcherImpl assumes that any PortletRequest
>>>it receives will be an instance of InternalPortletRequest.  This becomes
>>>a problem if a portal implementer needs to wrap the request using
>>>PortletRequestWrapper; the cast will fail.
>>>Other alternatives would be:
>>>         * Remove CoreUtils.getInternalRequest(..), and use a
>>>(InternalPortletRequest) cast on the assumption that all PortletRequests
>>>implement InternalPortletRequest.
>>>         * Have PortletRequestWrapper and subclasses implement
>>>InternalPortletRequest.
>>>         * No change.
>>>
>>>If no change, portal implementers should subclass
>>>PortletRequestWrapper+, which seems a shame since it would mean
>>>PortletRequestWrapper+ could never be safely used without subclassing.
>>>(Subclassing like :
>>>     class InternalRenderWrapper extends RenderRequestWrapper implements
>>>InternalPortletRequest {
>>>         public InternalRenderWrapper(RenderRequest renderRequest) {
>>>             super(renderRequest);
>>>         }
>>>         public void lateInit(HttpServletRequest webModuleServletRequest)
>>>{
>>>
>>>CoreUtils.getInternalRequest(getRenderRequest()).lateInit(webModuleServl
>>>etRequest);
>>>         }
>>>         public PortletWindow getInternalPortletWindow() {
>>>             return
>>>CoreUtils.getInternalRequest(getRenderRequest()).getInternalPortletWindo
>>>w();
>>>         }
>>>         public void setIncluded(boolean included) {
>>>
>>>CoreUtils.getInternalRequest(getRenderRequest()).setIncluded(included);
>>>         }
>>>         public boolean isIncluded() {
>>>             return
>>>CoreUtils.getInternalRequest(getRenderRequest()).isIncluded();
>>>         }
>>>     }
>
>
>James Nguyen
>I/T Professional
>600 Anton Boulevard - Suite 360
>Costa Mesa, California 92626
>
>"Cogito ergo sum"
>         -Rene Descartes
>
>


James Nguyen
I/T Professional
600 Anton Boulevard - Suite 360
Costa Mesa, California 92626

"Cogito ergo sum"
         -Rene Descartes