spring 配置

来源:互联网 发布:网络职业推手公司 编辑:程序博客网 时间:2024/05/17 21:03

spring-confog.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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--配置映射   映射-->
    <bean name="/hello" class="com.czz.spring.HellloController"></bean>
    <!-- 处理映射器 将bean 的name 作为 url 进行查找 需要在配置 handle指定 handle name(url) -->
    <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean>
    <!--处理器适配器  所有的适配器都要实现 HandlerAdapter-->
    <bean class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter"></bean>
    <!--试图解析器  -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"></bean> 
    </beans>