站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2EE 专题高手请进:换应用服务器后怎样处理web.xml文件?

高手请进:换应用服务器后怎样处理web.xml文件?

摘要: 高手请进:换应用服务器后怎样处理web.xml文件?


JB+tomcat

web.xml文件在tomcat不同版本间内容顺序不同,如把tomcat4改为tomcat5,就会出现如下提示错误:
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*)".

服务器改回tomcat5就一切正常了,那如果想换一个tomcat版本应该怎么办?如果想换一个服务器,如:websphere,又该怎么办?


websphere没有用过,我想如果你的程序框架设计的好的话,改什么服务器都是没有问题的.


准确的说web.xml是和servlet的版本有关,而不是和tomcat有关,只是tomcat4和tomcat5支持不同版本的servlet....

但是只要websphere,支持servlet2.4,应该没有问题...
(
)


qiyadeng(。。。。。),我现在在tomcat4下的web.xml的开始部分是这样的:
<?xml version="1.0" encoding="UTF-8"?>
web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

.....

和你写的相差很大啊,要改成你那样的吗?



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*)".
--------------------------------------------------------------
确认一下你的web.xml的内容是不是按照上面说的顺序写的,


不是改改声明就好了...因为4.0只支持servlet2.3...


关键是确定websphere是不是支持servlet2.4


↑返回目录
前一篇: 求助:关于自己写连接,INITIAL_CONTEXT_FACTORY和PROVIDER_URL怎么写?(高手快来帮忙啊)
后一篇: 求助:计算一个超长字符串中的子串个数