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

web配置,该怎么解决

2012-03-02 
web配置刚网上随便下了个web项目放到webapp里了结果访问工程文件夹下index.jsp 结果404试了试发现只要有WE

web配置
刚网上随便下了个web项目放到webapp里了
结果访问工程文件夹下index.jsp 结果404
试了试发现只要有WEB-INF就出404
web.xml内容 把里面.class都删了也不行 才学jsp,求被前辈指导

XML code
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4"     xmlns="http://java.sun.com/xml/ns/j2ee"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">        <filter>        <filter-name>struts2</filter-name>        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>    </filter>    <filter-mapping>        <filter-name>struts2</filter-name>        <url-pattern>/*</url-pattern>    </filter-mapping>        <taglib>        <taglib-uri>struts2</taglib-uri>        <taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>    </taglib></web-app>


[解决办法]
访问路径发下 路劲错了~
[解决办法]
Java code
 <taglib>        <taglib-uri>struts2</taglib-uri>        <taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>    </taglib>是来干嘛的?strust2不需要配置这个
[解决办法]
干嘛把taglib配到web.xml里?
404一般是你的路径有问题
[解决办法]
404是路径不存在

在配置文件中加上这个

 <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
 </welcome-file-list>

热点排行