[ 
https://issues.apache.org/jira/browse/PLUTO-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617017#action_12617017
 ] 

Steven Broadbridge commented on PLUTO-490:
------------------------------------------

There is an inconsistency in the Servlet API concerning the definition of the 
root context path.

>From ServetContext#getContextPath():
The context path always comes first in a request URI. The path starts with a 
"/" character but does not end with a "/" character. For servlets in the 
default (root) context, this method returns "". [This is word-for-word the same 
definition as in HttpServletRequest]

>From ServletContext#getContext(String):
The given path must be begin with "/", is interpreted relative to the server's 
document root and is matched against the context roots of other web 
applications hosted on this container.

Considering this, we cannot assume that only Tomcat has problems with 
getContext(""). One solution is to patch 
org.apache.pluto.core.PortletContextManager.getPortletContext(String) to 
substitute "/" for "". Another is to have PortletWindowConfig#createPortletId 
do the swap.

> Cannot deploy portlets to ROOT context
> --------------------------------------
>
>                 Key: PLUTO-490
>                 URL: https://issues.apache.org/jira/browse/PLUTO-490
>             Project: Pluto
>          Issue Type: Bug
>          Components: portal driver, portlet container
>    Affects Versions: 1.1.5
>         Environment: Tomcat 5.5
>            Reporter: Steven Broadbridge
>            Assignee: Eric Dalquist
>             Fix For: 2.0.0, 2.0-refactoring, 1.1.6
>
>         Attachments: pluto_490.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Deploying portlets to ROOT fails because of improper detection and handling 
> of the "" context path.
> DefaultApplicationIdResolver#resolveApplicationId(ServletContext) returns 
> "/hostName" for the root context instead of "", where "hostName" is the name 
> of the host containing the context (typically "localhost"). The program will 
> seem to work normally except when HttpServletRequest.getContextPath() is 
> called such as by the JSTL url tag. That method would then return the 
> incorrect value of  "/hostName".
> Even when the context path is correctly detected as "", the portletId created 
> by PortletWindowConfig#createPortletId(String, String, String) cannot by 
> parsed by PortletWindowConfig#fromId(String) because the latter throws an 
> exception if the id starts with ".".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to