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