zoukankan      html  css  js  c++  java
  • SpringMVC Controller 的简单应用

    <?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:tx="http://www.springframework.org/schema/tx"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/aop
            http://www.springframework.org/schema/aop/spring-aop.xsd
            http://www.springframework.org/schema/tx
            http://www.springframework.org/schema/tx/spring-tx.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc.xsd" >
    
        <!-- springmvc核心配置文件 -->
        <!--  映射处理器 --> 
          <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /> 
        <!-- 拦截的URL:  /lf/list.test -->
        <bean class="cn.zr.pringmvctest.BeanController" name="/lf/list.test"></bean>
    
    
    
    </beans>     
    package cn.zr.pringmvctest;
    
    import javax.naming.ldap.Control;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.Controller;
    
    public class BeanController implements Controller {
    
        @Override
        public ModelAndView handleRequest(HttpServletRequest arg0,
                HttpServletResponse arg1) throws Exception {
            
            System.out.println("进入BeanController。。。");
            ModelAndView modelAndView = new ModelAndView("/WEB-INF/jsp/list.jsp");
            
            return modelAndView;
        }
    
        
    
    }
  • 相关阅读:
    想用Nginx代理一切?行!
    [SuProxy]Ngnix+Lua 实现SSH2,LDAP,ORACLE,SQLSERVER等TCP/IP协议分析,劫持,代理,会话及负载
    hive分区表详细介绍
    hive 中自定义UDF函数和自定义UDTF函数
    yarn工作原理
    HDFS小文件问题
    HDFS读写流程
    利用 canvas 实现签名效果
    idea里面自带的翻译插件
    idea的set,get插件
  • 原文地址:https://www.cnblogs.com/lantu1989/p/6424283.html
Copyright © 2011-2022 走看看