springMVC注解

来源:互联网 发布:java ioc框架 编辑:程序博客网 时间:2024/05/19 04:02
    @PathVariable
是用来对指定请求的URL路径里面的变量 eg: Java代码 @RequestMapping(value = "form/{id}/apply", method = {RequestMethod.PUT, RequestMethod.POST}) {id}在这个请求的URL里就是个变量,可以使用@PathVariable来获取 @PathVariable和@RequestParam的区别就在于:@RequestParam用来获得静态的URL请求入参

@Validate 验证:

@iniBind 初始化

spring mvc 的 resources 注解 用来处理静态文件。
<mvc:resources mapping="/javascript/**" location="/static_resources/javascript/"/>
看到我所有的页面引用到/styles/**的资源都从/static_resources/css里面进行查找
jsp 中使用url: <link type="text/css" rel="stylesheet" href="<c:url value='/styles/siteboard.css'/>">
这样就 不会像controller一样被拦截了。


0 0
原创粉丝点击