JBoss 7:如何更改 WAR 上下文根 [英] JBoss 7: how to change a WAR context root

查看:31
本文介绍了JBoss 7:如何更改 WAR 上下文根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要部署在 WAR 文件 (app.war) 中的应用程序.部署后可以从http://:8080/app我想让它像http://:8080/secret/app

I have an application that is to be deployed in a WAR file (app.war). After deployment it is available from http://:8080/app I would like to have it being made available as something like http://:8080/secret/app

我搜索了文档,对于 JBoss 的 5 和 6,这似乎可以通过 jboss-web.xml 文件完成.我试过了,但没有运气.似乎 JBoss 7 只是忽略了 jboss-web.xml 中的元素.

I searched the documentation and for JBoss'es 5 and 6 this seems to be able to do with a jboss-web.xml file. I have tried it but with no luck. It seems that JBoss 7 just ignores the element inside jboss-web.xml.

我不知道这是否相关,但此应用程序同时具有 JSF 和 PrettyFaces.

I don't know if this is relevant but this application has both JSF and PrettyFaces.

有谁知道 JBoss 7 是否可以实现这种行为?如果是这样,怎么做?我仍在为此寻找答案.

Does anyone know if this behavior is possible with JBoss 7? If so, how can it be done? I am still trying to find an answer for this.

谢谢.

推荐答案

this 适用于 AS 7.0.1, WEB-INF/jboss-web.xml

this works in AS 7.0.1, WEB-INF/jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root>/my_custom_root</context-root>
</jboss-web>

我认为不可能有像server/something/app"这样的应用根目录,但你可以通过应用程序结构来模拟这种行为

I don't think it is possible to have app root like "server/something/app", but you can simulate this behavior through application structure

这篇关于JBoss 7:如何更改 WAR 上下文根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆