jboss简单使用(AS7):
将项目打成war包,放到jboss-as-web-7.0.0.Finalstandalonedeployments下
访问 alias .name+port+war包名
访问省去包名
在项目WEB-INF下加jboss-web.xml 内容
<jboss-web>
<context-root>/</context-root>
<virtual-host>firstJboss</virtual-host>
</jboss-web>
注:<context-root>/</context-root>表示可以直接通过根访问,不需要输入完整的项目名像tomcat context中的path;
<virtual-host>firstJboss</virtual-host>只有通过firstJboss才能访问。如果是多个项目的context-root都是/的话,只能通过virtual-host来区分的。
配置文件的
standalone.xml
<virtual-server name="firstJboss" default-web-module="war包名" enable-welcome-root="false">
<alias name="data.api.kuangke.com"/>可以配置多个alias
</virtual-server>