将 GWT 部署到 JBoss 时出现 web.xml 问题
我在 GWT 中开发了一个简单的应用程序。之后,我生成 war 文件并将其部署到 JBoss 中。但是,当我这样做时,我收到一条错误消息,例如:
元素类型“web-app”的内容 必须匹配 “(图标?,显示名称?,描述?,可分发?,上下文参数*,过滤器*,过滤器- 映射*、侦听器*、servlet*、servlet 映射*、会话配置?、mime 映射*、欢迎文件列表?、错误页面*、taglib*、资源环境引用*、资源- ref*、安全约束*、登录配置?、安全角色*、env-entry*、ejb-ref*、ejb-local-ref*)"。
另一方面,我的 web.xml 如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/resources/spring.xml</param-value>
</context-param>
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>main.java.com.gwt.app.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/zb_app/greet</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener- class>
</listener>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>ZB_app.html</welcome-file>
</welcome-file-list>
</web-app>
也就是说,网络应用程序标签包含一些强制标签,我不知道有什么问题,有人可以帮我解决这个问题
?
吗
I have developed a simple application in GWT. After that, I generate war file and deploy it into JBoss. However, when I do this, I get an error message like:
The content of element type "web-app"
must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-
mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-
ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
On the other hand, my web.xml is the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/resources/spring.xml</param-value>
</context-param>
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>main.java.com.gwt.app.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/zb_app/greet</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener- class>
</listener>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>ZB_app.html</welcome-file>
</welcome-file-list>
</web-app>
It is to say, the web-app tag contains some mandatory tags. I do not what is the problem, could someone help me with the problem?
Thank you in advance!
Regards!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将侦听器声明放在 servlet 之前,元素的顺序应该不是问题,但我在某些容器中看到过这种情况(不记得是否是 JBoss)
Try to put the listener declaration before the servlets, the order of the elements shouldn't be a problem but I've seen this in some container (don't remeber if it was JBoss)
序列应该是 context-param -listener -servlet ,这里是
The sequence should be context-param - listener - servlet and here it is