springmvc.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns="http://www.springframework.org/schema/beans"
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="com.ssm.controller"/>
<!--两个标配-->
<!-- 解决映射器处理器和映射器适配器 -->
<mvc:annotation-driven/>
<!-- 处理静态资源 -->
<mvc:default-servlet-handler/>
<!-- 视图解析器 这里可以不用配置,因为是通过ajax异步调用,本人习惯配置上,根据需要更改-->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>