Java Web请求中的默认地址:sendRedirect:绝对路径与相对路径

Java Web请求中的默认地址:sendRedirect:绝对路径与相对路径,java,web,jboss,Java,Web,Jboss,我有一个EAR文件,它的application.xml类似于 <web-uri>pharma.war</web-uri> <context-root>pharma</context-root> 登录是war文件的WEB-INF中定义的servlet。在servlet中,我说它是为了重定向到app/launchPage.html。它应该重定向到 http://localhost:8080/pharma/app/launchPage.html 但它正

我有一个EAR文件,它的application.xml类似于

<web-uri>pharma.war</web-uri>
<context-root>pharma</context-root>
登录是war文件的WEB-INF中定义的servlet。在servlet中,我说它是为了重定向到app/launchPage.html。它应该重定向到

http://localhost:8080/pharma/app/launchPage.html 但它正在转向

http://localhost:8080/app/launchPage.html.
JBossEAP4.2中也存在同样的问题。我正在尝试迁移到JBoss EAP 6.3.0。我想,我错过了一些配置,但不确定是什么配置

ServletRootPath="/Login"
redirectPagePath="app/launchPage.html"

Java Code: ctx.getResponse().sendRedirect(redirectPagePath);
ctx.getResponse() returns an object of type HttpServletResponse

请告诉我,我在这里缺少什么

您在重定向中缺少request.getContextPath,因为我正在传递一个相对路径,它是否应该自己预先设置contextpath?
ServletRootPath="/Login"
redirectPagePath="app/launchPage.html"

Java Code: ctx.getResponse().sendRedirect(redirectPagePath);
ctx.getResponse() returns an object of type HttpServletResponse