框架
CaediosViolet
这个作者很懒,什么都没留下…
展开
-
后端-框架-MyBatis-动态SQL-trim
MyBatis-动态SQL where标签 <select id="getUserList" resultMap="getUserList"> select user.* from smbms_u原创 2018-10-26 17:53:59 · 132 阅读 · 0 评论 -
后端-框架-Spring-Spring MVC参数传递(注解实现)
后端-框架-Spring-Spring MVC参数传递(注解实现) Spring MVC搭建 @RequestMapping @RequestMapping trait value URL method get or post params vairables package cn.smbms.controller; import org.apache.log4j.L...原创 2018-11-13 14:37:16 · 374 阅读 · 1 评论 -
后端-框架-Spring-MyBatis-自动装配
后端-框架-Spring-MyBatis-自动装配 bean标签下autowire属性 autowire value no 手动装配 byName 类名装配 byType 类型装配 constructor 构造器装配 beans标签下default-autowire属性 autowire value no 手动装配 byName 类名装配 b...原创 2018-11-11 14:50:15 · 280 阅读 · 0 评论 -
后端-框架-Spring-MyBatis-Spring配置文件拆分
后端-框架-Spring-MyBatis-Spring配置文件拆分 多个配置文件加载方法1 //在引用时利用重载方法加载 ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml","applicationContext-dao","applicationContext-web"); 多个配...原创 2018-11-11 15:06:22 · 206 阅读 · 0 评论 -
后端-框架-Spring-MyBatis-注入映射器
后端-框架-Spring-MyBatis-注入映射器 其中的配置文件 <!-- 数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver.原创 2018-11-08 10:12:09 · 185 阅读 · 0 评论 -
后端-框架-Spring-Spring MVC环境搭建
后端-框架-Spring-Spring MVC环境搭建 1. 导入相关包 spring-web-5.1.1.RELEASE.jar spring-webmvc-5.1.1.RELEASE.jar 2. 配置文件 web.xml中配置Servlet <!-- 对于头文件去Tomcat中的例子找 --> <!-- 对于其中配置去Spring的doc找 --> <?...原创 2018-11-12 13:10:36 · 408 阅读 · 0 评论 -
后端-框架-Spring-Spring MVC环境搭建(注解实现)
后端-框架-Spring-Spring MVC环境搭建(注解实现) 1. 导入相关包 spring-web-5.1.1.RELEASE.jar spring-webmvc-5.1.1.RELEASE.jar 2. 配置文件 web.xml中配置Servlet &amp;amp;lt;!-- 对于头文件去Tomcat中的例子找 --&amp;amp;gt; &amp;amp;lt;!-- 对于其中配置去Spring的doc找 --&amp原创 2018-11-12 16:53:19 · 228 阅读 · 0 评论 -
后端-框架-Spring MVC-Hibernate验证
jar包 hibernate-validator-4.3.2.Final.jar jboss-logging-3.1.0.CR2.jar validation-api-1.0.0.GA.jar pojo加入注释(具体查API) @NotEmpty(message=“用户名不能为空”) private String userName; @NotNull(message=“用户密码不能为空”)...原创 2018-11-22 09:11:18 · 150 阅读 · 0 评论 -
后端-框架-Spring MVC-Date类型转换失败
在Pojo中加入注释 @DateTimeFormat(pattern=&quot;yyyy-MM-dd&quot;) private String userName; 参考文档 SpringMVC日期类型转换问题原创 2018-11-22 09:31:16 · 260 阅读 · 0 评论 -
后端-框架-Spring MVC-文件上传
接口 MutipartResolver 实现类 CommonsMutipartResolver or StandardServletMutipartResolver 步骤 导入jar包 commons-io-2.6.jar commons-fileupload-1.3.3.jar springmvc-servlet.xml #id必须严格按照multipartResolver编写,否则...原创 2018-11-29 11:10:47 · 218 阅读 · 1 评论 -
后端-框架-Spring MVC-JSON传送时间数据
解决方法 1. 局部配置 @DateTimeFormat(pattern="yyyy-MM-dd") @JSONField(format="yyyy-MM-dd") private Date birthday; //出生日期 2.全局配置(仅使用与fastJson) 修改FastJsonHttpDateFormat中features属性 此时UserController下的方法应直接返回一个对...原创 2018-12-04 16:59:57 · 282 阅读 · 0 评论 -
后端-框架-Spring MVC-多视图解析器
业务要求 通过Request所请求的格式进行Response的格式 <beans> <!-- 多视图解析器 --> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="favorParameter" va...原创 2018-12-04 17:32:00 · 177 阅读 · 0 评论 -
后端-框架-Spring MVC-REST风格
对比 普通风格 REST风格 http://localhost:8080/SMBMS/user/view?id=11 http://localhost:8080/SMBMS/user/view/11 实现 //UserController------------ @RequestMapping(value="/view",method=RequestMethod.GET) p...原创 2018-11-27 18:58:51 · 126 阅读 · 0 评论 -
后端-框架-Spring MVC-FastJSON对象中文乱码问题
问题出现原因 StringHttpMessageConverter中默认编码格式为ISO-8859-1 解决方法 1. 灵活配置 将请求报文头为application/json的charset修改 同时value=&amp;quot;/view.html&amp;quot;中去掉html以免响应的报文与请求的报文不一致 @RequestMapping(value=&amp;quot;/view&amp;quot;,method=RequestM原创 2018-12-03 22:28:04 · 432 阅读 · 0 评论 -
后端-框架-Spring-bean的作用域-未完成
后端-框架-Spring-bean的作用域 scope Value singleton 单例模式 prototype 每次创建新实例 request Web环境,每次HTTP请求创建新实例 session Web环境,同一会话下单例模式 ...原创 2018-11-10 17:39:56 · 204 阅读 · 0 评论 -
后端-框架-Spring-dataSource配置
后端-框架-Spring-dataSource配置 dbcp配置方式1(只适用于单个项目) 在database.properties中 #properties不需要对特殊符号转义 jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306/smbms?useUnicode=true&characterEnco...原创 2018-11-10 17:25:16 · 202 阅读 · 0 评论 -
后端-框架-Spring-IoC-property-设值注入
后端-框架-Spring-IoC设值注入 预先写好spring的类 package cn.springdemo; public class HellowSpring { private String who; public String getWho() { return who; } //此处的setWho的who为xml中的name public void setWho(Str...原创 2018-10-28 16:22:56 · 187 阅读 · 0 评论 -
后端-框架-MyBatis-动态SQL-foreach
&amp;amp;lt;select id=&amp;quot;getUserListByRoleIdForeach&amp;quot; resultMap=&amp;quot;getUserListByRoleIdForeach&amp;quot;&amp;amp;gt; select * from smbms_user where userRole in &amp;amp;lt;fo原创 2018-10-26 17:12:29 · 189 阅读 · 0 评论 -
后端-框架-MyBatis-动态SQL-choose
后端-框架-MyBatis-动态SQL-choose public interface UserMapper{ public List&lt;User&gt; getUserListByChoose(@Param("userName")String userName, @Param("userRole")Integer roleId, @Param(&原创 2018-10-26 17:52:52 · 144 阅读 · 0 评论 -
后端-框架-MyBatis-动态SQL-limit
后端-框架-MyBatis-动态SQL-limit public interface UserMapper { public int count(); public List&lt;User&gt; getUserListLimit(@Param("userName")String userName, @Param("userRole")Integer roleId,原创 2018-10-27 10:07:24 · 1747 阅读 · 0 评论 -
后端-框架-Spring-实现动态组装的打印机
后端-框架-Spring-实现动态组装的打印机 主要告诉自己ref和value的区别 ref为自己设置好的bean,直接引用 value为bean中property中的值 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xml...原创 2018-10-30 15:28:02 · 789 阅读 · 0 评论 -
后端-框架-Spring-IoC-contructor-arg-构造注入
后端-框架-Spring-IoC-contructor-arg public class UserServiceImpl implements UserService { // 声明接口类型的引用,和具体实现类解耦合 private UserDao dao; private String s1; private String s2; private int i1; public U...原创 2018-11-01 09:11:03 · 540 阅读 · 0 评论 -
后端-框架-Spring-IoC-p:命名
后端-框架-Spring-IoC-p:命名 其他类 public class User{ private Integer id; // 用户ID private String username; // 用户名 // getter &amp; setter public Integer getId() { return id; } public void setId(Intege...原创 2018-11-01 09:32:35 · 146 阅读 · 0 评论 -
后端-框架-Spring-IoC-多种类型注入
后端-框架-Spring-IoC-多种类型注入 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc...原创 2018-11-01 09:58:17 · 116 阅读 · 0 评论 -
后端-框架-Spring-IoC-注解注入-自动装配
后端-框架-Spring-IoC-注解注入 @Service(&amp;amp;amp;amp;quot;UserDao&amp;amp;amp;amp;quot;) public class UserDaoImpl implements UserDao { public void save(User user) { System.out.println(&amp;amp;amp;amp;quot;保存用户信息到数据库&amp;amp;a原创 2018-11-03 09:27:44 · 172 阅读 · 0 评论 -
后端-框架-Spring-MyBatis
后端-框架-Spring-MyBatis-整合(未完待续) 其中的配置文件 &amp;lt;bean id=&quot;DataSource&quot; class=&quot;org.apache.commons.dbcp2.BasicDataSource&quot;&amp;gt; &amp;lt;property name=&quot;driverClassName&a原创 2018-11-06 14:40:08 · 347 阅读 · 0 评论 -
后端-框架-Spring-MyBatis-事物增强
后端-框架-Spring-MyBatis-业务层添加声明事物 &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;原创 2018-11-09 13:14:36 · 134 阅读 · 0 评论 -
后端-框架-Spring-AOP 事物增强
后端-框架-Spring-AOP-注解注入 如果碰到代码无误,可能是JDK与aspectjweaver版本不匹配 pointcut位置 package cn.service; import cn.service.UserService; import javax.annotation.Resource; import org.springframework.beans.factory.ann...原创 2018-11-04 13:11:37 · 345 阅读 · 0 评论 -
后端-框架-SSM框架整合
1. 导入jar包 commons apache-log4j-1.2.17 mysql-connector-java-5.1.46 mybatis-3.4.6+mybatis-spring-1.3.2 spring-framework-5.1.1 2. 配置文件(/rescources) web.xml database.properties+log4j.properties mybatis...原创 2018-12-12 09:22:39 · 472 阅读 · 0 评论