zoukankan      html  css  js  c++  java
  • StringMVC

    public class FirstController implements Controller {
        public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
            ModelAndView mv=new ModelAndView();
            mv.setViewName("index");
            return mv;
        }
    }
    

      

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:p="http://www.springframework.org/schema/p"
           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/aop http://www.springframework.org/schema/aop/spring-aop.xsd
            http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx.xsd
    ">
      <!--视图解析器-->
    
      <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/"></property>
        <property name="suffix" value=".jsp"></property>
      </bean>
    

      

    <!DOCTYPE web-app PUBLIC
     "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd" >
    
    <web-app>
      <display-name>Archetype Created Web Application</display-name>
      <!--配置前端控制器-->
      <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    
        <!--初始化参数-->
        <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>classpath:springmvc.xml</param-value>
        </init-param>
    
        <load-on-startup>1</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
      </servlet-mapping>
    
    </web-app>
    

      

  • 相关阅读:
    vsftpd的详细配置讲解
    ActiveMQ安装与配置
    Apache安装完之后再安装其他模块
    搭建 LAMP apache2.4 + php5.5 + mysql5.5/6 配置文件没有作用的问题
    LAMP apache2.4 + php5.5 + mysql5.5/6
    进制之间的转换
    Mac 常用属性
    关于颜色值透明度的设置
    关于TextView 的属性
    Android 关于软键盘
  • 原文地址:https://www.cnblogs.com/2652405350wch/p/7398807.html
Copyright © 2011-2022 走看看