struts-2.1.8.1+jquery-1.3.2+spring-framework-2.5.6集成
2009-12-23 00:00:00 来源:WEB开发网没有与数据库交互,直接判断了一下字符串.呵呵 .留作Hibernate来完成吧.
5.接下来当然要看下web.xml是怎么配置struts和spring的:
代码
1 <?xml version="1.0" encoding="UTF-8"?>
2 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
5 <!-- 配置struts2拦截器 -->
6 <filter>
7 <filter-name>struts2</filter-name>
8 <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
9 </filter>
10 <filter-mapping>
11 <filter-name>struts2</filter-name>
12 <url-pattern>/*</url-pattern>
13 </filter-mapping>
14 <!-- 配置默认首页 -->
15 <welcome-file-list>
16 <welcome-file>index.jsp</welcome-file>
17 </welcome-file-list>
18 <login-config>
19 <auth-method>BASIC</auth-method>
20 </login-config>
21 <!-- 配置spring监听 -->
22 <listener>
23 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
24 </listener>
25 <context-param>
26 <param-name>contextConfigLocation</param-name>
27 <param-value>classpath:applicationContext.xml</param-value>
28 </context-param>
29 </web-app>
赞助商链接