You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Jay D. McHugh (JIRA)" <ji...@apache.org> on 2008/03/14 20:28:24 UTC

[jira] Created: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

getContextRoot() returns forward slash rather than empty string for apps deployed to root context
-------------------------------------------------------------------------------------------------

                 Key: GERONIMO-3921
                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: Tomcat
    Affects Versions: 2.1, 2.0.2, 2.0.1, 2.0, 2.0.x, 2.1.1, 2.2
            Reporter: Jay D. McHugh
            Assignee: Jay D. McHugh


An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".

dcherk wrote:
> I am deploying my war file into the root context with the following
> deployment plan:
> ----------
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
>     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
>     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
>     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
>   ...
>   <context-root></context-root>
>   ...
> </web-app>
> ----------
> 
> The application starts up properly, and responds on http://localhost, as
> expected.
> 
> However, when I examine request.getContextPath(), I get a forward slash:
> "/".
> 
> This is incorrect, as far as I can tell.  According to the API
> (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> ----------
> For servlets in the default (root) context, this method
> [HttpServletRequest.html.getContextPath()] returns "".
> ----------
> 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602734#action_12602734 ] 

Jay D. McHugh commented on GERONIMO-3921:
-----------------------------------------

Has anyone checked to confirm that this works in Jetty?

If not, I'll check in the next few days and close this issue.

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>             Fix For: 2.0.x, 2.1.1, 2.2
>
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578906#action_12578906 ] 

Jay D. McHugh commented on GERONIMO-3921:
-----------------------------------------

Fix committed to branches/2.1

Sending        plugins/tomcat/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Transmitting file data .
Committed revision 637227.

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Updated: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Joe Bohn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bohn updated GERONIMO-3921:
-------------------------------

    Affects Version/s:     (was: 2.0.x)
        Fix Version/s:     (was: 2.0.x)
                       2.0.3

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>             Fix For: 2.0.3, 2.1.1, 2.2
>
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578903#action_12578903 ] 

Jay D. McHugh commented on GERONIMO-3921:
-----------------------------------------

Fix committed to trunk.

Sending        plugins/tomcat/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Transmitting file data .
Committed revision 637223.


> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579917#action_12579917 ] 

Donald Woods commented on GERONIMO-3921:
----------------------------------------

Committed to branches/2.0 as Rev638438

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578907#action_12578907 ] 

Jay D. McHugh commented on GERONIMO-3921:
-----------------------------------------

Fixed it too fast.
Forgot the parens on the length function to the fix on trunk (branches/2.1 was correct).

Sending        plugins/tomcat/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Transmitting file data .
Committed revision 637232.


> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579991#action_12579991 ] 

Jay D. McHugh commented on GERONIMO-3921:
-----------------------------------------

Jarek,

I just checked the Jetty 'wrapper' around the getContext method and it does not have the same
check for the first character not being a '/'.

So it _should_ be functioning correctly.

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Closed: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jay D. McHugh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jay D. McHugh closed GERONIMO-3921.
-----------------------------------


Jetty was not an issue.

They did not have the same check for apps deployed to the root context.

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>             Fix For: 2.0.3, 2.1.1, 2.2
>
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Resolved: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods resolved GERONIMO-3921.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2
                   2.1.1
                   2.0.x

> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>             Fix For: 2.0.x, 2.1.1, 2.2
>
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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


[jira] Commented: (GERONIMO-3921) getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Posted by "Jarek Gawor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-3921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578930#action_12578930 ] 

Jarek Gawor commented on GERONIMO-3921:
---------------------------------------

Jay,

How does Jetty handle this? I think Jetty checks/modifies the contextPath in the same way as Tomcat used to, so it might need a fix also.



> getContextRoot() returns forward slash rather than empty string for apps deployed to root context
> -------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3921
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3921
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Tomcat
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.x, 2.1, 2.1.1, 2.2
>            Reporter: Jay D. McHugh
>            Assignee: Jay D. McHugh
>
> An app deployed to the root context should have "" returned by getContextRoot() - On Tomcat, we are returning "/".
> dcherk wrote:
> > I am deploying my war file into the root context with the following
> > deployment plan:
> > ----------
> > <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
> >     xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
> >     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
> >     xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
> >   ...
> >   <context-root></context-root>
> >   ...
> > </web-app>
> > ----------
> > 
> > The application starts up properly, and responds on http://localhost, as
> > expected.
> > 
> > However, when I examine request.getContextPath(), I get a forward slash:
> > "/".
> > 
> > This is incorrect, as far as I can tell.  According to the API
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()):
> > ----------
> > For servlets in the default (root) context, this method
> > [HttpServletRequest.html.getContextPath()] returns "".
> > ----------
> > 

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