之前已经实现了spring mvc的入门例子及如何处理带参数的请求Controller编写。本文主要记录:

1)重定向请求

2)处理路径中含有变量的请求

3)使用JSR-303进行校验

① 首先,编写一个方法实现一个表单的展现:

//展示表单
    //params 可限制该方法只对包含特定参数的请求进行处理
    @RequestMapping(method=RequestMethod.GET,params="new")
    public String createForm(Model model){
        model.addAttribute("user", new User());
        return "/user/edit";
    }

注意到,params="new",这意味着该方法处理的请求Url:xxx/home?new (home是定义Controller的请求路径)

这是跳转的页面定义(使用了velocity模板):

<form method="post">
    <div>
        <label for="userName">userName:</label>
        <input name="userName" value="$!user.userName">
        <span>$!br.getFieldError("userName").getDefaultMessage()</span>
    </div>
    
    <div>
        <label for="email">Email:</label>
        <input name="email" value="$!user.email">
    </div>
    
    <div>
        <label for="age">age:</label>
        <input name="age" value="$!user.age">
    </div>
    <button type="submit">Submit</button>
</form>

② 然后,在页面上填入值,点击提交,如果不指定form的提交路径,则默认是xx/home(Controller的请求路径),此时需要编写处理表单的输入方法:

 //处理表单输入
    @RequestMapping(method=RequestMethod.POST)
    //@Valid是对user参数的验证
    public String addForm(@Valid User user,BindingResult br,Model model){
        if(br.hasErrors()){
            model.addAttribute("br",br);
            return "/user/edit";
        }
        userService.saveUser(user);
        return "redirect:/home/"+user.getUserName();
    }

a.在输入参数中,对User使用了@Valid,表示在user传入之前会进行校验,这是使用了JSR-303的校验规则,如何定义校验规则呢?在后面④-->>

b.在方法处理上, 如果校验失败,则会将BindingResult传入到方法中,通过br.hasErrors进行判断是否校验成功,如果失败,将br放在model中,以便在edit.vm页面中显示,这就是在页面edit.vm中,有<span>$!br.getFieldError("userName").getDefaultMessage()</span>(页面只写了这一处)

c.通过重定向到请求:/home/user.getUserName.路径中含有变量,因此需要定义处理请求路径变量的方法。

③ 定义处理请求路径变量的方法

 
    //处理带有路径变量的请求
    @RequestMapping(value="/{username}",method=RequestMethod.GET)
    public String showUser(@PathVariable String username,Model model){
        model.addAttribute("username", username);
        return "home";
    }

在@RequestMapping中,value使用了占位符{username},在参数String username使用了@PathVariable,表示的是路径的变量,说明该方法处理的请求为:xx/home/somebodyName,如请求的url为xxx/home/hahaha,则方法中的username为hahaha

④ 使用JSR-303进行校验

之前使用了@Valid User user,校验的是user对象,因此需要对User进行编写校验规则。使用的是JSR-303,在使用前,需要引入相关的jar包,如果是maven工程,需要定义maven坐标:

<dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>4.2.0.Final</version>
                <!-- <optional>true</optional> -->
            </dependency>

OK,看下User的校验规则

public class User {
    
    @Range(min=1,max=10,message="userName must be between 1 and 10 character long")
    @Pattern(regexp="^[a-zA-z0-9]+$",message="userName Invalid")
    private String userName;
    
    private String email;
    
    private int age;
   
   //setter and getter... 
   
}

运行工程,记录下效果:

1、请求展示表单的路径,输入过长的Username后提交:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoEAAADUCAIAAABs7W6CAAAb40lEQVR4nO3d+XObBWLG8feP6QyE0nFnttPptGXodmZ3od0GwpIsLBUkkBQWAhsSjAnLrs2WI0pomWwwNLNN02DSJA7ZyDZxrnUcQu7L2Jbt+JBvO7Ys2bIu2zqi/iDp1XvriK1Xx/czzyTW6/eUXunR+0qWhG3v/+eFm90nv2sjpIRz4Wb3pu27Nm3fxd5OSj4XbnZvrLJufGcne3vhR3jjvR0nz1+vP/EtISWck+evb3jrow1vfcTeTko+J89fX7/tw/XbPmRvL/wITz238ZM9e9+p+ZiQEs4ne/Y+vu6lx9e9xN5OSj6f7Nn7+LoXH1/3Int74Udw+yOEEEIIyX8Elz9CCCGEkPwniw52esODdz03e0Yufj9w7nrPmcudZy53tlzrvvj9wM2ekYHJOac3bPr2EEIIIcUSYcYfSZvJucVbvWOnL3e294/fdfsCS+HFUDQcvReO3lsMRQNL4Wm3r71//PTlzht3RifnFjOZJyGEEFLmEWZ8EYM4veHv+yZbrnePTs0tLEVCkXtL4XuL4XsLoVQWw/eWwvfiv5qY8Z673vN936TTGzaeMyGEE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SVYzt21dM3Cep2/S7qFmNafuLYWP2uHceu5G9QK6GnctdMy81xpb7+ypioWCyGygYA7Sle2SMi2o4+Qb8o+MTRttzkr3ZSk3bufIIgdn6VnbZz507WnNmFs1Ozc9Kz5l9qzE5hr5exJQGobADQpCKVHY1GrSoUjUZR2QCgPcUre1iFUNkAoElFKjsSiZhVKBKJoLIBQHuKXOLA5XL5/f4hVfH7/S6XC5c4AADtEavskydPnjp1yuPxRFTF4/GcOnXqJC4kBgCaU+RyvXV1dVVVVZt/iV05VVVV1dXVbc3TBwCwlYpUNgAAlA5UNgCAaqCyAQBUA5UNAKAaqGwAANVAZQMAqAYqGwBANVDZAACqgcoGAFANVDYAgGqgsgEAVAOVDQCgGqhsAADVQGUDAKgGKhsAQDVQ2QAAqoHKBgBQDVQ2AIBqoLIBAFQDlQ0AoBqobAAA1UBlAwCoBiobAEA1UNkAAKqBygYAUA1UNgCAavw/6fx6WHyh2egAAAAASUVORK5CYII=" alt="" />

4、输入正常的Username后提交(没传count,因此没有值):

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXkAAACiCAIAAAAr7yoyAAAOnklEQVR4nO3c/W8T5wEH8PtjJk1CmjJp0zRtQ90mtSvr1nYt6aCdeSkw+pJSoKylDJJ0W1ss9bcWTRMVNDIM7AFx4oYQWhJoiIGQF/yWECeO49hxYse+OH493/ns/WD7fHc+uyFtngu570dfifjJc3ePo9y3d+cq1IHjJ7tvDpq6biHIBk73zcHdRz7afeQj/LarFeqFV/Z+8ul/jrZ+jCAbOJ98+p8tL+3Z8tIe/LarFSqazCEIgqx1qEgyhyAIstZ5hK4Jx7np+djQuO/2g6newfHrVsd1q+PGvbHbD6aGxn1TwaVwnFP9/SAIsj5DLSZz35rgEjM84e+xOmyTgfloIpXlGJbn+DzH5xmWT2W5UDRhmwz0WB33H84Gl5iV7BNBEE2FWkzk6iQc5x64gzcGx2YXljLZHJvLZ7k8w+UzbCUMl89y+eK35hbjvYPjD9zBcJyrv2cEQTQ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gAgAV0DACSgawCABHQNAJCArgEAEtA1AEACugYASEDXAAAJ6BoAIAFdAwAkoGsAgAR0DQCQgK4BABLQNQBAAroGAEhA1wAACegaACABXQMAJKBrAIAEdA0AkICuAQAS0DUAQAK6BgBIQNcAAAnoGgAg4f8LNCGP8TvxrAAAAABJRU5ErkJggg==" alt="" />

spring mvc表单的展现、输入处理、校验的实现的更多相关文章

  1. 使用Spring MVC表单标(转)

    概述     在低版本的Spring中,你必须通过JSTL或<spring:bind>将表单对象绑定到HTML表单页面中,对于习惯了Struts表单标签的开发者来说,Spring MVC的 ...

  2. Spring MVC - 表单处理示例

    环境搭建 环境: Intellij IDEA Spring MVC 完整的项目文件结构如下所示: Student.java package com.ktao.controller; public cl ...

  3. Spring MVC表单处理

    以下示例演示如何编写一个简单的基于Web的应用程序,它使用Spring Web MVC框架使用HTML表单. 首先使用Eclipse IDE,并按照以下步骤使用Spring Web Framework ...

  4. Spring MVC表单标签

    从Spring 2.0开始,Spring MVC开始全面支持表单标签,通过Spring MVC表单标签,我们可以很容易地将控制器相关的表单对象绑定到HTML表单元素中. form标签     和使用任 ...

  5. Spring MVC表单提交

    实际应用中,列表中的单条记录的修改,可能需要传很多对象参数到后台服务器,Spring MVC表单标签<form:> 提供了一种简洁的提交方式. <form id="form ...

  6. [Spring MVC] - 表单提交

    Spring MVC自带的表单标签比较简单,很多时候需要借助EL和JSTL来完成. 下面是一个比较简单的表单提交页面功能: 1.User model package com.my.controller ...

  7. Spring MVC 表单校验 (七)

    完整的项目案例: springmvc.zip 目录 实例 除了依赖spring-webmvc还需要依赖jackson-databind(用于转换json数据格式)和hibernate-validato ...

  8. Spring MVC表单防重复提交

    利用Spring MVC的过滤器及token传递验证来实现表单防重复提交. 创建注解 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RU ...

  9. spring mvc表单form值自动传到javabean-注解@ModelAttribute

    直接通过Form Bean进行表单可以简化表单提交的处理,特别是对于复杂表单,过于简单的表单就不建议了,因为毕竟需要额外创建一个Form Bean.前段时间项目中有一个比较复杂的表单,有多层次而且涉及 ...

随机推荐

  1. Python学习笔记:py2exe打包Python程序

    使用py2exe将一个Python程序打包成一个exe程序,这样Python程序也可以在没有安装Python的环境中运行Python程序了.使用这个工具需要写一个用于打包的setup.py文件(名称可 ...

  2. zoj 4056

    At 0 second, the LED light is initially off. After BaoBao presses the button 2 times, the LED light ...

  3. c++,友元类和友元函数

    都是声明时友元的东西可以访问自己类的私有和保护成员 类的友元 友元是C++提供的一种破坏数据封装和数据隐藏的机制. 通过将一个模块声明为另一个模块的友元,一个模块能够引用到另一个模块中本是被隐藏的信息 ...

  4. 针对NM_CUSTOMDRAW消息的学习

    消息的形式:1 窗口消息,2 命令消息,3 WM_NOTIFY消息,4 自定义消息 我们的NM_CUSTOMDRAW消息就是就属于第三种WM_NOTIFY消息,而添加消息映射的方法分为两种: BEGI ...

  5. UOJ 152 汉诺塔 分治

    题目链接 题意: 有三根编号为\((1, \, 2, \, 3)\)的柱子,然后第一根柱子上有编号为\(1 \sim n(n \leq 10000)\)的盘子,从上到下第\(i\)个盘子的编号是\(A ...

  6. hdu3613 Best Reward

    先manacher.然后前缀和价值,枚举切点,O(1)判断切后是否回文 #include <iostream> #include <cstring> #include < ...

  7. python week08 并发编程之多线程--理论部分

    一. 什么是线程 1.定义 线程就像一条工厂车间里的流水线,一个车间里可以用很多流水线,来执行生产每个零部件的任务. 所以车间可以看作是进程,流水线可以看作是线程.(进程是资源单位,线程是执行单位) ...

  8. day03_03 第一个Python程序

    Python的安装 之前安装了python2.7.11,接下来的课程因为是python3的,需要再安装一个python3版本...... 1.进入python.org进行选择安装 2.或者选择课件里的 ...

  9. JAVA-两种后台页面跳转方式

    1.请求转发 RequestDispatcher rd = request.getRequestDispatcher("url"); rd.forward(request, res ...

  10. 【bzoj1307】玩具 单调栈

    题目描述 小球球是个可爱的孩子,他喜欢玩具,另外小球球有个大大的柜子,里面放满了玩具,由于柜子太高了,每天小球球都会让妈妈从柜子上拿一些玩具放在地板上让小球球玩. 这天,小球球把所有的N辆玩具摆成一排 ...