首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Element type "listener" must be declared 如何解决

2011-12-25 
Element type listener must be declared 怎么解决.环境是Webshere4.0,架构是spring+struts.Tomcat5.0+J

Element type "listener" must be declared 怎么解决.
环境是Webshere4.0,架构是spring+struts.   Tomcat   5.0+JDK1.4运行正常。
web.xml
-----------------------------
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   web-app   PUBLIC   "-//Sun   Microsystems,   Inc.//DTD   Web   Application   2.2//EN "   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd ">

//错误信息
----------------------------
com.ibm.etools.archive.exception.ArchiveRuntimeException:   An   Exception   occurred   while   parsing   xml:Line   #:   13:Column   #:   12
Stack   trace   of   nested   exception:
org.xml.sax.SAXParseException:   Element   type   "listener "   must   be   declared.

[解决办法]
xml:Line #: 13:Column #: 12
检查下web.xml文件

[解决办法]
我感觉你是在配置web.xml中listener时出现的问题.
Webshere4.0支持的是servlet2.2吧?listener是在2.3中才有的
還有就是Servet 2.4,web.xml裡的元素才能够不依順序排列
如果是servlet2.3那么在servlet 2.3要把listener的tag放在servlet tag之前

热点排行