Git Product home page Git Product logo

spring-mvc's Introduction

Spring-MVC

Spring MVC框架学习

1. Frist Spring MVC Demo

2. Spring MVC注解方式

 spring mvc注解驱动(annotation-driven)和扫描器(component-scan) 
 @Controller and  @RequestMapping(value = "/hello.do")

   最主要的一点,此方式的项目中没有类似springmvc02-servlet.xml的springmvc配置文件
   而是定义了一个配置springmvc的类

@Configuration and @ComponentScan(basePackages = "com.songyl.webmvc.controller")

3. 配置HandlerMapping 的三种方式

springmvc04-servlet.xml里面配置

3.1 根据BeanName找到对应的Controller

3.2 根据SimpleUrlHandler找到对应的Controller

3.3 根据ControllerClassName找到对应的Controller

4. 请求参数的三种方式

UserController.java里面配置

4.1 通过设置HttpServletRequest来获取请求参数

4.2 直接设置参数

4.2 通过封装一个类的属性来传递参数

QQ20171019151108.jpg

<c:forEach>标签用于通用数据循环,它有以下属性

    | 属 性	    |描 述	                  |是否必须   |缺省值            |
    |----------- |:-------------------:|:---------:|:-------------------|
    | items      | 进行循环的项目       |	否	   |无                  |
    | begin      | 开始条件	          | 否	      | 0                  |
    | end	      | 结束条件	          | 否	      | 集合中的最后一个项目 |
    | step	      | 步长	            | 否	   | 1                  |
    | var	      |代表当前项目的变量名   | 否	      | 无                  |
    | varStatus	 | 显示循环状态的变量    | 否        | 无                  |

spring-mvc's People

Contributors

dacang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.