摘要: <dependencies> <!--Junit--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <!--数据库驱动--> <d 阅读全文
posted @ 2021-04-18 13:07 川上富江 阅读(41) 评论(0) 推荐(0)
摘要: @RestController 下面的不走视图解析器 @ResponseBody//他就不会走视图解析器 会直接返回一个字符串 阅读全文
posted @ 2021-04-17 11:58 川上富江 阅读(61) 评论(0) 推荐(0)
摘要: Controller返回JSON数据 Jackson应该是目前比较好的json解析工具了 当然工具不止这一个,比如还有阿里巴巴的 fastjson 等等。 我们这里使用Jackson,使用它需要导入它的jar包; <!-- https://mvnrepository.com/artifact/com 阅读全文
posted @ 2021-04-17 11:56 川上富江 阅读(60) 评论(0) 推荐(0)
摘要: <form action="${pageContext.request.contextPath}/requ01" method="post"> 用户名<input type="text" name="user"> </br> 密码<input type="password" name="pwd">< 阅读全文
posted @ 2021-04-13 11:15 川上富江 阅读(50) 评论(0) 推荐(0)
摘要: 不得不说,乱码问题是在我们开发中十分常见的问题,也是让我们程序猿比较头大的问题! 以前乱码问题通过过滤器解决 , 而SpringMVC给我们提供了一个过滤器 , 可以在web.xml中配置 . 修改了xml文件需要重启服务器! <filter> <filter-name>encoding</filt 阅读全文
posted @ 2021-04-12 19:59 川上富江 阅读(46) 评论(0) 推荐(0)
摘要: @Controller @RequestMapping("/User") public class UserController { @GetMapping("/t1") public String test1(@RequestParam("username") String name, Model 阅读全文
posted @ 2021-04-12 19:41 川上富江 阅读(46) 评论(0) 推荐(0)
摘要: 学习测试 在新建一个类 RestFulController @Controller public class RestFulController {} 1 2 在Spring MVC中可以使用 @PathVariable 注解,让方法参数的值对应绑定到一个URI模板变量上。 @Controller 阅读全文
posted @ 2021-04-12 17:24 川上富江 阅读(56) 评论(0) 推荐(0)
摘要: xml 配置 <!--配置声明式事务--> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <constructor-arg ref="da 阅读全文
posted @ 2021-04-08 23:22 川上富江 阅读(97) 评论(0) 推荐(0)
摘要: 编写实体类编写核心配置文件编写接口编写mapper.xml测试resources 下的db.properties driver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/mybatis?&useUnicode=true&charact 阅读全文
posted @ 2021-04-08 14:02 川上富江 阅读(30) 评论(0) 推荐(0)
摘要: 二 DiyPointCut.class public class DiyPointCut { public void before(){ System.out.println(" 在前 "); } public void after(){ System.out.println(" 在后 "); } 阅读全文
posted @ 2021-04-08 13:27 川上富江 阅读(51) 评论(0) 推荐(0)