无法在GlassFish上更改WAR-app的Context Root

shu*_*533 4 java glassfish war

我在Netbeans中创建名为TestA的新war-app.然后,我创建了新的Glassfish部署描述符glassfish-web.xml,其中包含以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
  <context-root>/new_context_root</context-root>
</glassfish-web-app>
Run Code Online (Sandbox Code Playgroud)

然后我将我的应用程序部署到GF.Context Root Still/TestA,而不是/ new_context_root.为什么?

Glassfish版本是3.1.2.2

UPD

如果我通过autodeploy文件夹进行部署,则上下文根目录会正常更改,但不会从Web管理员更改

小智 8

从glassfish web admin,在部署新WAR时,必须将字段Root Root字段留空:使用glassfish-web.xml文件中的字段.