请选择 进入手机版 | 继续访问电脑版

湖南新梦想

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1124|回复: 0

ssm环境搭建003

[复制链接]

7

主题

7

帖子

31

积分

新手上路

Rank: 1

积分
31
发表于 2023-9-21 00:09:56 | 显示全部楼层 |阅读模式
springmvc.xml配置
<?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"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/s ... ing-context-3.1.xsd
      http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

        <context:component-scan base-package="com.pcp.controller"/>
        <context:component-scan base-package="com.pcp.config"/>
        <context:component-scan base-package="com.pcp.interceptor"/>
        <!--  告诉springmvc处理系统中静态资源的访问问题  -->
        <!--  springmvc默认的生效,当访问静态资源(css/js/图片...)找不到Controller的时候,就直接找到静态资源并返回  -->
        <!--  注意:这行配置会导致springmvc注解失效  -->
        <mvc:default-servlet-handler/>


        <!-- 让失效的注解重新生效   -->
        <mvc:annotation-driven/>

      

</beans>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|湖南新梦想 ( 湘ICP备18019834号-2 )

GMT+8, 2023-12-4 01:59 , Processed in 0.039687 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表