码迷,mamicode.com
首页 > 编程语言 > 详细

springmvc配置文件...(权当参考)

时间:2019-10-22 18:32:56      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:jsp   efi   int   访问   文件   not   inter   source   servlet   

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<!--组件扫描 主要扫描controller-->
<context:component-scan base-package="com.zn.contrller"></context:component-scan>
<!--配置mvc注解驱动-->
<mvc:annotation-driven></mvc:annotation-driven>
<!--内部资源视图解析器-->
<!--简单的说就是将jsp页面的前缀和后缀单独写出来,这样就可以直接写jsp页面的名字了,我在这里和别的jsp放在一起,所以只需要在前缀加上"/"-->
<bean id="resourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!--开发静态资源访问权限-->
<!--DispatcherServlet(前端控制器)请求映射配置为"/",则Spring MVC将捕获Web容器所有的请求,包括静态资源的请求,Spring MVC将它们当成一个普通请求处理,
在这里开放的访问路径权限会将springmvc中捕获的静态资源重新发送回服务器,让服务器处理-->
<mvc:default-servlet-handler></mvc:default-servlet-handler>


</beans>

springmvc配置文件...(权当参考)

标签:jsp   efi   int   访问   文件   not   inter   source   servlet   

原文地址:https://www.cnblogs.com/znzuinb/p/11721279.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!