You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-dev@portals.apache.org by Satish Sekharan <sa...@mun.ca> on 2005/08/01 14:11:35 UTC

Re: struts portlet

Changed org.apache.portals.bridges.struts.PortletServletResponseWrapper

diff -u -r1.3 PortletServletResponseWrapper.java
--- PortletServletResponseWrapper.java    4 Feb 2005 17:34:26 -0000    1.3
+++ PortletServletResponseWrapper.java    1 Aug 2005 11:57:02 -0000
@@ -46,10 +46,13 @@
     public String encodeURL(String path)
     {
+        /*
         if (actionResponse)
             return path;
         else
             return super.encodeURL(path);
+         */
+        return path;
     }

Now the urls are rendered correctly inside uPortal, but clicking the 
link seems to do nothing. It renders the same page again and again.

Example of an url to view an event >>
http://bluefin.cc.mun.ca:8080/uPortal/portlet-params@uP_portlet_action%253Dtrue%2526_spage%253D%252FeventView%25252Edo%2526_sorig%253D%252FshowMain%25252Erdo@portlet-params.tag.121ab2b24a79c61c.render.userLayoutRootNode.target.86.uP#3E1797A49EC1A2EC56613BFFF543932A/86?eventId=1

Ate Douma wrote:

> Satish Sekharan wrote:
>
>> Looked at the Struts rewrite tag code (for Struts 1.2.4) line 569 >>
>>
>>       if (pageContext.getSession() != null) {
>>            HttpServletResponse response = (HttpServletResponse) 
>> pageContext.getResponse();
>>            if (redirect) {
>>                return (response.encodeRedirectURL(url.toString()));
>>            } else {
>> ==>         return (response.encodeURL(url.toString()));
>>            }
>>        } else {
>>            return (url.toString());
>>        }
>>
>> url  variable >> /cal/initialise.rdo
>>
>> response.encodeURL(url.toString()) >> 
>> http://bluefin.cc.mun.ca:8080/cal/initialise.rdo
>
> As I expected :-(
>
> A bit weird implementation by uPortal of the response.encodeURL if you 
> ask me
> and clearly something I'd never expect from the rewrite tag...
>
> I'll have to think about this one.
> Because now a hardcoded url is returned for a internal Struts action, 
> I'm not sure how to distinguish
> these from other hardcoded urls which are *not* meant to be rendered 
> as portlet url.
>
> Anyways, it'll have to wait until after this weekend (sorry: too much 
> other things to look after).
> At least, we now know what the real problem is.
>
>>
>> Ate Douma wrote:
>>
>>> Satish Sekharan wrote:
>>>
>>>> As you suggested I started debugging the Struts Bridge rewrite tag
>>>>
>>>> At line 102 after the Struts transform the tag to an url
>>>>
>>>> url = bodyContent.getString();
>>>>
>>>> The url variable is >>  
>>>> http://bluefin.cc.mun.ca:8080/cal/initialise.rdo
>>>
>>>
>>>
>>> While this probably isn't for the eventView.do I can understand the 
>>> problem
>>> now if Struts itself already returns a fully qualified url (which I 
>>> never encountered before).
>>>
>>> After looking at the Struts rewrite tag code (for Struts 1.2.4), the 
>>> only part I can
>>> think of this can happen is when it calls response.encodeURL(url).
>>> Please could you try to debug this as well (look at line 564 from 
>>> o.a.s.taglib.TagUtils.java)?
>>> If you use a different version of Struts, please let me know.
>>>
>>>>
>>>> Ate Douma wrote:
>>>>
>>>>> Satish Sekharan wrote:
>>>>>
>>>>>> Inside header.jsp >>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Ok. You didn't attach that one :-)
>>>>>
>>>>>>
>>>>>> <eventView><html:rewrite action="eventView.do"/></eventView>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I'm puzzled how this could result in an 
>>>>> /http://bluefin.cc.mun.ca:8080/cal/eventView url.
>>>>> The Struts Bridge rewrite tag first lets the Struts tag itself 
>>>>> transform the tag to an url.
>>>>> That should lead to something like "/eventView".
>>>>> Then, the Struts Bridge will create an portlet url with a 
>>>>> parameter _spage=/eventView.
>>>>>
>>>>> So, where this is transformed to 
>>>>> _spage=/http://bluefin.cc.mun.ca.8080/cal/eventView I don't know 
>>>>> for sure
>>>>> but I do suspect the xslt template.
>>>>>
>>>>> I noted that cal.xml contains
>>>>>       <urlprefix>
>>>>>         http://bluefin.cc.mun.ca:8080/cal
>>>>>       </urlprefix>
>>>>> Maybe that is injected somewhere by the template?
>>>>>
>>>>> If you can't find out quickly, I suggest debugging the Struts 
>>>>> Bridge rewrite tag. Put a break at line 114
>>>>> and you will be able to monitor the incoming url, the result from 
>>>>> Struts itself and the final result
>>>>> produced by the bridge.
>>>>>
>>>>>>
>>>>>> It is using the struts tags to create the links. This link is 
>>>>>> then included in the xml data and then it is used in the xslt 
>>>>>> tranformation.
>>>>>>
>>>>>> This is an example of a link that is created in the portlet using 
>>>>>> the struts bridge >>
>>>>>>
>>>>>> http://bluefin.cc.mun.ca:8080/uPortal/portlet-params@uP_portlet_action%253Dfalse%2526_spage%253D%252Fhttp%253A%252F%252Fbluefin%25252Ecc%25252Emun%25252Eca%253A8080%252Fcal%252FeventView%25252Edo@portlet-params.tag.d8f4b0a73dcc9f58.render.userLayoutRootNode.target.86.uP#8038586D11EC4AF81E0B20CE84F08347/86?eventId=1 
>>>>>>
>>>>>>
>>>>>> Ate Douma wrote:
>>>>>>
>>>>>>> Satish Sekharan wrote:
>>>>>>>
>>>>>>>> I just sent a email with some attachements. It just 
>>>>>>>> disappeared. I will send it again.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Well, I've seen them already :-)
>>>>>>> As far as I can tell from this, you aren't using the Struts tags 
>>>>>>> to render
>>>>>>> the links are you?
>>>>>>>
>>>>>>> I guess the xslt template is doing that.
>>>>>>> In that case, you don't have a Struts Bridge problem but a 
>>>>>>> general JSR-168 one.
>>>>>>>
>>>>>>> You *must* use RenderResponse.createRenderURL() or 
>>>>>>> RenderResponse.createActionURL()
>>>>>>> to be able to communicate back to the portlet...
>>>>>>> The Struts Bridge tags does that under the covers (using 
>>>>>>> StrutsPortletURL).
>>>>>>>
>>>>>>> If you are *not* using the Struts Bridge tags, you need to use 
>>>>>>> the porlet api
>>>>>>> (or the porlet tags) yourself.
>>>>>>>
>>>>>>> Good luck,
>>>>>>>
>>>>>>> Ate
>>>>>>>
>>>>>>>>
>>>>>>>> Ate Douma wrote:
>>>>>>>>
>>>>>>>>> Satish,
>>>>>>>>>
>>>>>>>>> You don't give me much to go by for your problem.
>>>>>>>>> But the logged path 
>>>>>>>>> "/http://bluefin.cc.mun.ca:8080/cal/eventView" certainly
>>>>>>>>> doesn't look valid (note the '/' in front of the http:// part).
>>>>>>>>> Most likely you are not using the struts-bridge link (or 
>>>>>>>>> resource) tag correctly.
>>>>>>>>> Please provide a snippet from the jsp code and the related 
>>>>>>>>> struts mapping.
>>>>>>>>> Maybe then I'll be able to help you more.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --------------------------------------------------------------------- 
>>>>>>>
>>>>>>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>>>>>>> For additional commands, e-mail: 
>>>>>>> bridges-dev-help@portals.apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>>>>>> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>>>>> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>>>> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>>> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
>> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>>
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: bridges-dev-help@portals.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org