随笔分类 - 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
阅读全文
摘要:需要增加filter过滤器:HiddenHttpMethodFilter 可以将post请求转成delete和put方式的rest风格,当然也包括post;
阅读全文
摘要:运行结果: {id}相当于占位符,根据URL传进来的参数,传递给integer id;
阅读全文
摘要:URL路径由value决定,eg:value="/hello"。 method参数:RequestMethod.POST,RequestMethod.GET请求方法,比如GET、POST 除此之外,还有: param:参数设置 @RequestMapping还支持ANT风格的通配符: @Reques
阅读全文
摘要:1.导入jar包 除此之外,还需要 以上是被要求最少jar包 2.配置web.xml 配置servlet,SpringMVC是通过servlet作为入口与struts2以filter作为入口不同! 3.创建一个Helloworld类 4.创建springmvc.xml配置文件并且配置注解扫描与视图解
阅读全文
摘要:http://localhost:8080/SpringMVC/hello/45 id就被赋值为45
阅读全文
摘要:访问路径url应为http://localhost:8080/SpringMVC/zhangpn/hello 与struts2中的包的命名空间和action的名称规则类似
阅读全文
posted @ 2018-06-19 12:52
呦,可以呦

浙公网安备 33010602011771号