zoukankan      html  css  js  c++  java
  • @RequestMapping的value属性

    package com.zby.controller;
    
    import javax.servlet.http.HttpServletRequest;
    
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.servlet.ModelAndView;
    
    @Controller
    @RequestMapping(value = "/zby")
    public class JspController {
        /**
         * ant风格占位符:* ? **
         * @param modelAndView
         * @return
         */
        @RequestMapping(value = "/**/jsp?/*/{sss}/${param}/#{'age'.toLowerCase()}",params="")
        public ModelAndView jsp(ModelAndView modelAndView, @PathVariable("sss") String sss, HttpServletRequest httpServletRequest) {
            System.out.println(httpServletRequest.getRequestURI());
            modelAndView.addObject("msg", "this is model");
            modelAndView.setViewName("hello");
            return modelAndView;
        }
    }

    1.路径匹配
    2.Ant风格占位符
    3.PathVariable
    4.placeHolder
    5.SpEL

  • 相关阅读:
    C 字符串
    C 函数指针、回调函数
    C 指针
    C 数组、枚举类型enum
    C 函数声明、函数参数
    C 内置函数
    C 流程控制
    C 储存类与运算符
    C变量和常量
    名词解释
  • 原文地址:https://www.cnblogs.com/zby9527/p/8329077.html
Copyright © 2011-2022 走看看