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

查看:135
本文介绍了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.

谢谢.

推荐答案

这在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天全站免登陆