有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

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

我有一个EAR文件及其应用程序。xml类似于

<web-uri>pharma.war</web-uri>
<context-root>pharma</context-root>

启动应用程序时,我使用以下URL:

http://localhost:8080/pharma/Login

登录是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

你能告诉我,我在这里错过了什么吗


共 (0) 个答案