cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: CocoonPortlet needs to allow overriding servlet-path parameter with preferences.
Date Thu, 01 Feb 2007 08:25:22 GMT
Hi Woonsan,

thanks for the patch! I'm wondering a little bit about the following
code (I removed some lines to just quote the important parts):

a)        String servletPath = this.servletPath;

          ...
        if (this.servletPath.startsWith("/")) {
            this.servletPath = this.servletPath.substring(1);
        }
        if (this.servletPath.endsWith("/")) {
            this.servletPath = servletPath.substring(0,
servletPath.length() - 1);
        }

        String pathInfo = getPathInfo(request);

z)        String uri = servletPath;

In line a) you create a new local variable and initialize it with the
value if the instance variable servletPath. Finally in z) you assign
the value of the local variable to "uri".

Inbetween you check the value of the instance variable servletPath and
change it eventually. I think, it would be correct to check the *local*
variable servletPath and change this instead.

What do you think?

Carsten

Woonsan Ko wrote:
> Hi Carsten,
> 
> Sorry it took so long to get back to you.
> My INBOX became overloaded and now I finally caught up.
> 
> I just posted my patch to JIRA.
> Thanks.
> 
> Regards,
> 
> Woonsan
> 
> --- Carsten Ziegeler <cziegeler@apache.org> wrote:
> 
>> Woon-San Ko wrote:
>>> Hi, all.
>>>
>>> The CocoonPortlet in BRANCH_2_1_X does not allow overriding the *servlet-path*
init parameter
>> by
>>> preferences.
>>> So, portal users have to add portlet tags in the portlet.xml whenever they need
to use another
>>> coplet in the portal site.
>>>
>>> If the CocoonPortlet reads preferences to override the *servlet-path*, portal
users can use
>> many
>>> coplet fragments without tedious portlet tag additions.
>>>
>> Hi,
>>
>> I think this is a good addition to the ManagedCocoonPortlet. Can you
>> please come up with a proper patch that you file into Jira? Every patch
>> should go through our tracking system. If you also could change the code
>> a little bit to avoid the code duplication (by factoring this out into a
>>  method) would be great!
>>
>> Thanks
>> Carsten
>>
>> -- 
>> Carsten Ziegeler - Open Source Group, S&N AG
>> http://www.s-und-n.de
>> http://www.osoco.org/weblogs/rael/
>>
> 
> 
> 
>  
> ____________________________________________________________________________________
> Get your own web address.  
> Have a HUGE year through Yahoo! Small Business.
> http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
> 


-- 
Carsten Ziegeler
http://www.osoco.org/weblogs/rael/

Mime
View raw message