struts2+spring+hibernate 的问题,新人没有可用分,大家帮忙

Achilles_tang 2008-07-15 01:10:41
在CSDN上下载的例子:http://download.csdn.net/source/513097
把文档中所有的包都找全了
导入工程,没有错误,部署时404的错误,为了找到什么原因,在根目录下写了一个index.html,无法打开,于是估计是WEB.XML的问题
删除后 ,可以访问index.html但是访问index.jsp出错
org.apache.jasper.JasperException: The Struts dispatcher cannot be found
估计是web.xml的问题

内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" 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">

<display-name>musicForStruts2 </display-name>

<filter>
<filter-name>hibernateFilter </filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>hibernateFilter </filter-name>
<url-pattern>*.action </url-pattern>
</filter-mapping>
<filter>
<filter-name>struts-cleanup </filter-name >
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>

<filter>
<filter-name>struts2 </filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts-cleanup </filter-name>
<url-pattern> /* </url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>struts2 </filter-name>
<url-pattern> /* </url-pattern>
</filter-mapping>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp </welcome-file>
</welcome-file-list>
</web-app>
...全文
41 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧