随笔分类 -  SpringMVC

摘要:POM.xml文件: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.a 阅读全文
posted @ 2018-06-22 13:01 呦,可以呦 阅读(702) 评论(0) 推荐(0)
摘要:获取cookie值 阅读全文
posted @ 2018-06-21 08:28 呦,可以呦 阅读(100) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-06-21 08:23 呦,可以呦 阅读(160) 评论(0) 推荐(0)
摘要:需要增加filter过滤器:HiddenHttpMethodFilter 可以将post请求转成delete和put方式的rest风格,当然也包括post; 阅读全文
posted @ 2018-06-21 07:37 呦,可以呦 阅读(169) 评论(0) 推荐(0)
摘要:运行结果: {id}相当于占位符,根据URL传进来的参数,传递给integer id; 阅读全文
posted @ 2018-06-20 22:41 呦,可以呦 阅读(562) 评论(0) 推荐(0)
摘要:URL路径由value决定,eg:value="/hello"。 method参数:RequestMethod.POST,RequestMethod.GET请求方法,比如GET、POST 除此之外,还有: param:参数设置 @RequestMapping还支持ANT风格的通配符: @Reques 阅读全文
posted @ 2018-06-20 21:57 呦,可以呦 阅读(407) 评论(0) 推荐(0)
摘要:1.导入jar包 除此之外,还需要 以上是被要求最少jar包 2.配置web.xml 配置servlet,SpringMVC是通过servlet作为入口与struts2以filter作为入口不同! 3.创建一个Helloworld类 4.创建springmvc.xml配置文件并且配置注解扫描与视图解 阅读全文
posted @ 2018-06-20 20:46 呦,可以呦 阅读(237) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-06-19 13:36 呦,可以呦 阅读(96) 评论(0) 推荐(0)
摘要:http://localhost:8080/SpringMVC/hello/45 id就被赋值为45 阅读全文
posted @ 2018-06-19 13:25 呦,可以呦 阅读(444) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-06-19 13:14 呦,可以呦 阅读(114) 评论(0) 推荐(0)
摘要:访问路径url应为http://localhost:8080/SpringMVC/zhangpn/hello 与struts2中的包的命名空间和action的名称规则类似 阅读全文
posted @ 2018-06-19 12:52 呦,可以呦