java
aimosy
这个作者很懒,什么都没留下…
展开
-
对象的hashCode
Java中的hashCode方法就是根据一定的规则将与对象相关的信息(比如对象的存储地址,对象的字段等)映射成一个数值 所以有: 如果两个对象的equals()是true, 那么这两个对象的hashCode就一定相等。 列如:a.equals(b)==true 就一定会有 a.hashCode()==b.hashCode(); 反之,两个对象的hashCode相同,他们不一定会equals...原创 2018-08-11 11:02:00 · 1131 阅读 · 0 评论 -
获取mybatis执行的sql语句
@Autowiredprivate SqlSessionFactory sqlSessionFactory;public int updateByPrimaryKeySelective(AGsJbxx entity) { String sql = sqlSessionFactory.getConfiguration() .getMappedStatement("com.hx.tpa...原创 2018-09-27 22:02:14 · 12370 阅读 · 0 评论 -
controller接收列表参数,List<Entity>
转https://blog.csdn.net/lightofsms/article/details/80722034$.ajax请求加请求头contentType: 'application/json;charset=utf-8'var data =[];data.push({username: "yss"});$.ajax({ type: "post", url: "...转载 2018-09-14 21:22:17 · 3820 阅读 · 0 评论 -
对象属性值为null时,不返回该对象属性
在对象名上注解@JsonInclude(JsonInclude.Include.NON_NULL)原创 2018-09-13 20:52:41 · 8224 阅读 · 2 评论 -
前端传参给后台,转数据格式
在controller类中@InitBinderpublic void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringFormat());} class StringFormat extends PropertyEditorSupport{ ...原创 2018-09-13 20:50:55 · 2701 阅读 · 0 评论 -
事务回滚
1、首先在spring配置文件中配置&lt;!-- 开启事务 --&gt; &lt;bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt; &lt;property nam原创 2018-09-13 20:35:44 · 159 阅读 · 0 评论 -
springmv重定向
controller跳到另外一个controller: 转:https://www.cnblogs.com/henuyuxiang/p/6933381.html转载 2018-09-17 10:56:10 · 440 阅读 · 0 评论 -
后台时date类型传到前端变数字的解决方法
在要传到前端的类的date属性上加注解,这样到前端就不会变数字了@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")原创 2018-09-01 14:47:01 · 3789 阅读 · 0 评论 -
内网电脑访问不了另外一台电脑启动的服务器,跨域问题
服务器启动,前端同事访问不了,也检查防火墙,开了防火墙,还是访问不了,地址也没问题,后来发现是跨域问题。解决方法:public class SimpleCORSFilter implements Filter { protected final Logger log = LoggerFactory.getLogger(getClass()); @Override ...原创 2018-08-23 20:51:30 · 6044 阅读 · 0 评论 -
设置web项目启动默认页面为controller方法
配置默认访问controller方法方法一: 在mvc配置文件中配置<!-- 定义无Controller的path<->view直接映射 --><mvc:view-controller path="/" view-name="redirect:login" />在web.xml配置文件中配置<welcome-file-list>...原创 2018-08-19 16:24:51 · 8948 阅读 · 5 评论 -
mybatis的批量插入
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> <!-- WARNING - @mbg.generated This element is automatically generated by MyB...原创 2018-08-18 15:00:27 · 412 阅读 · 0 评论 -
批量导入数据遇到的问题(INSERT 语句中行值表达式的数目超出了 1000 行值的最大允许值。)
INSERT 语句中行值表达式的数目超出了 1000 行值的最大允许值。 之前用insert一条一条循环导入, 这样比较费时间,就用 insert into admUser(username, mobile, age) values(,,),(,,),(,,)来批量导入, 导入数据多出现这样的问题INSERT 语句中行值表达式的数目超出了 1000 行值的最大允许值。数据库一次性...原创 2018-08-18 14:53:18 · 8449 阅读 · 0 评论 -
设置web线程——Tomcat线程配置
转:https://www.cnblogs.com/chengssblog/p/6635211.html 设置web线程需要在Tomcat配置文件server.xml中配置1、打开/conf/server.xml<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="...转载 2018-08-11 23:06:23 · 1086 阅读 · 0 评论 -
Servlet的线程安全性
转:https://blog.csdn.net/qq_38989725/article/details/74078819属性的线程安全:ServletContext,不是线程安全的,多线程可以同时读写。使用时要注意。 HttpSession,不是线程安全的,比如用户打开多个浏览器窗口时候就会产生多个请求针对同一个session的操作。使用时要注意。 ServletRequest,线程安...转载 2018-08-11 20:17:25 · 203 阅读 · 0 评论 -
springMvc 将对象json返回时自动忽略掉对象中的特定属性的注解方式
转https://blog.csdn.net/a491857321/article/details/78761857/https://blog.csdn.net/sanjay_f/article/details/47304509转载 2018-12-02 16:56:24 · 3181 阅读 · 0 评论