[jboss-jira] [JBoss JIRA] (WFLY-3744) ServletContext.getContextPath() for ROOT.war should be "", not "/"

Sean Flanigan (JIRA) issues at jboss.org
Fri Aug 29 00:14:00 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-3744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996773#comment-12996773 ] 

Sean Flanigan commented on WFLY-3744:
-------------------------------------

A workaround which seems to help: create an Undertow ServletExtension which does DeploymentInfo.setContextPath("") when ServletContext.getContextPath() returns "/".  

This might have side effects though, because it's unclear whether DeploymentInfo's definition of contextPath (no JavaDocs) agrees with ServletContext.getContextPath().


> ServletContext.getContextPath() for ROOT.war should be "", not "/"
> ------------------------------------------------------------------
>
>                 Key: WFLY-3744
>                 URL: https://issues.jboss.org/browse/WFLY-3744
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Web (Undertow)
>            Reporter: Sean Flanigan
>            Assignee: Stuart Douglas
>         Attachments: ROOT.war
>
>
> According to JavaDocs (ServletContext.getContextPath and HttpServletRequest.getContextPath): "For servlets in the default (root) context, this method returns "". "
> Using latest 9.0.0.Alpha1-SNAPSHOT nightly build from https://ci.jboss.org/hudson/job/WildFly-latest-master/1334/ the value is returned in both cases as "/" rather than "" (empty string).



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list