如何在Wildfly中定义Context Path? [英] How to define Context Path in Wildfly?

查看:358
本文介绍了如何在Wildfly中定义Context Path?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用以下代码设置tomcat中的上下文路径,我可以通过覆盖tomcat的默认路径直接使用 localhost:8080 访问我的应用程序。 p>

I've used the following code to set the Context Path in tomcat where I can access my application directly using localhost:8080 by overriding the tomcat's default path.

<Context path="" docBase="G:\bitbucket\projectpath\project\build\libs\project-1.0" workDir="G:\bitbucket\projectpath\project\build\libs\project-1.0\work"  debug="0" reloadable="false" autoDeploy="true" unpackWARs="true" crossContext="true"/>

现在我将使用wildfly-8.2.0作为运行时环境。我试图直接将.war文件粘贴到 G:\wildfly-8.2.0.Final\standalone\deployments 中,我可以在浏览器中访问我的项目,如 localhost:8080 / project-1.0

Now I'm going to use wildfly-8.2.0 as runtime environment. I tried by directly pasting the .war file into G:\wildfly-8.2.0.Final\standalone\deployments and I can access my project in browser like localhost:8080/project-1.0.

我需要设置与wildfly相同的配置,就像我在tomcat通过覆盖wildfly的默认欢迎页面来访问我的项目 localhost:8080 。我试图在野鸭中做同样的事情,但我坚持在哪里做。在wildfly文件夹中有很多.xml文件(与tomcat的简单的server.xml文件进行比较时),我在哪里开始混淆。我使用如何在Wildfly中设置上下文路径进行搜索,但没有成功。任何人都可以帮我做如何做吗?如果它与编码有关,那么我可以做很多的搜索,至少我可以得到一些想法,但是我被困在配置上。感谢Advance。

I need to setup the same configuration to wildfly like I've done in tomcat to access my project in localhost:8080 by overriding the wildfly's default welcome page. I tried to do the same in wildfly but I'm stuck where to do that. There are lot of .xml files in wildfly folder (when comparing with tomcat's simple server.xml file) which I get confused on where to start with. I searched using "How to set Context Path in Wildfly", but got no success. Can anyone help me on how to do it..? If it's related to coding, then I can do lot of searches and atleast I can get some Ideas, but I'm stuck here at configuration. Thanks in Advance.

推荐答案

您可以在/WEB-INF/jboss-web.xml文件中添加您部署的应用程序:

You can do this in the by adding a /WEB-INF/jboss-web.xml file in the application that you deploy:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
      http://www.jboss.com/xml/ns/javaee
      http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
   <context-root>/</context-root>
</jboss-web>

这篇关于如何在Wildfly中定义Context Path?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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