spring3 mvc简约搭建
来源:互联网 发布:百度关键词优化软件 编辑:程序博客网 时间:2024/05/01 21:29
1.引包:
2.web.xml配置:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>springmvc</display-name>
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- Spring配置 -->
<!-- ====================================== -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- 指定Spring Bean的配置文件所在目录。默认配置在WEB-INF目录下 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
3.springmvc-servlet配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd ">
<context:component-scan base-package="spring.mvc.demo.action"></context:component-scan>
<mvc:annotation-driven></mvc:annotation-driven>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
- spring3 mvc简约搭建
- Spring3.2 MVC框架搭建
- 搭建spring3 的mvc开发
- spring3 mvc
- Spring3 MVC
- Spring3 MVC
- Spring3 MVC
- Spring3 MVC
- Spring3 MVC
- spring3 mvc
- 搭建spring3.0 mvc遇到的常见问题及解决方法
- spring3.1.1 mvc使用注解搭建hello world
- spring3.1.1 mvc使用注解搭建hello world
- Spring3 MVC 笔记
- spring3.0 MVC
- spring3 web mvc framework
- spring3 MVC restful风格
- Spring3 MVC 深入研究
- 三极管BJT与场效应管FET的区别
- IOS7状态栏设置
- viewdidload, loadview, viewdidunload说明
- 倔强歌词
- 简单取石子游戏~博弈
- spring3 mvc简约搭建
- eclipse 快捷键大全
- 配置本地的yum源
- 小虾米(一)
- MongoDB基本命令
- 一种基于UDP的可靠传输协议
- 掘强
- UIImage的使用
- 还没开始,已然结束