geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay D. McHugh" <jaydmch...@gmail.com>
Subject Re: request.getContextPath() returns '/' in the default (root) context
Date Fri, 14 Mar 2008 19:36:36 GMT
Dave,

You appear to be right.

Your deployment descriptor should be fine.  I found the code that is 
causing the problem.

I created a JIRA to track this 
(https://issues.apache.org/jira/browse/GERONIMO-3921) but it should be 
fixed (in source at least) very soon.

What version of Geronimo are you using?

Will you be able to move up to the next released version?  Or is there 
some constraint that will force you to stay on the level that you are 
currently on?

(I just want to make sure that the fix gets to you as soon as possible)


Jay

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 "".
> ----------
> 
> 
> So what is wrong?  Am I using an incorrect deployment plan?  How do I
> property deploy into the root context?
> 
> Thanks,
> Dave Cherkassky
>   VP of Software Development
>   DJiNN Software Inc.
> 
> P.S.:
> I also tried <context-root>/</context-root>, with the same results.
> 
> P.P.S.:
> The same application deployed in plain vanilla Tomcat 4.1 return the
> expected result (empty string) for request.getContextPath().
> 

Mime
View raw message