上一页 1 ··· 12 13 14 15 16
摘要: 拦截path 不拦截path --> //实现handlerInterceptor 接口 public c... 阅读全文
posted @ 2020-10-17 14:53 黑质白章 阅读(92) 评论(0) 推荐(0) 编辑
摘要: //异常处理类 @Controller public class ServletInterceptor { @RequestMapping("testException") public String testException(){ System.ou... 阅读全文
posted @ 2020-10-17 14:44 黑质白章 阅读(84) 评论(0) 推荐(0) 编辑
摘要: <!--jsp页面--> <form action="testUpload" method="post" enctype="multipart/form-data"> <input type="file" name="file"><br> <input type="text" name="desc" 阅读全文
posted @ 2020-10-17 14:24 黑质白章 阅读(100) 评论(0) 推荐(0) 编辑
摘要: @Controller //转换器 例如 user{id,name,age},请求1-zs-23. public class ServletConvert { @RequestMapping("MyConvert") public String convert(@RequestParam... 阅读全文
posted @ 2020-10-17 14:14 黑质白章 阅读(98) 评论(0) 推荐(0) 编辑
摘要: //服务器端 //浏览器端展示方式 1、el表达式 ${} ${user} ===>>> User(id=1, name=zs) 使用el表达式默认一如下次序进行查询值: ${pageScope} 当前页 ${requestScope} request域 ${sessionScope} session 域 ${applicationSc... 阅读全文
posted @ 2020-10-17 11:58 黑质白章 阅读(659) 评论(0) 推荐(0) 编辑
摘要: @Controller //@SessionAttributes(value="stu")//将数据存入session域中,可以多写(value={"stu1,stu2,stu3"}) @SessionAttributes(types=Student.class) //某一对象类型(types={Student.class... 阅读全文
posted @ 2020-10-17 11:54 黑质白章 阅读(697) 评论(0) 推荐(0) 编辑
摘要: <!-- Web.xml初始配置--> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 阅读全文
posted @ 2020-10-17 11:30 黑质白章 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Spring-mvc 开发初始环境 此截图适用于maven开发,非maven开发则不需要Servlet.jar除了spring-webmvc其他的Spring jar包都属于spring 框架。 Junit.jar和hamcrest.jar用于测试。 Commons-io.jar 和 Commons 阅读全文
posted @ 2020-10-17 11:30 黑质白章 阅读(856) 评论(0) 推荐(0) 编辑
摘要: //mvc获取get参数@RequestMapping(value = "test7/{name}", method = RequestMethod.POST) public String test7(@PathVariable("name") String name) { return "MyJs 阅读全文
posted @ 2020-10-17 11:24 黑质白章 阅读(465) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16