摘要: 1.pom.xml配置下载需要的jar。 junit junit 4.11 test org.springframework spring-test 3.2.3.RELEASE test org.springframework spring-context 3.2.3.RELE... 阅读全文
posted @ 2015-09-16 14:03 java后端领域 阅读(3454) 评论(0) 推荐(0) 编辑
摘要: 1. 建立properties文件:我在resource下面建立一个config文件夹,config文件夹里面有mytest.properties文件,文件内容如下:sam.username=samsam.password=1234562.在spring.xml里面配置一些内容,让tomcat启动时... 阅读全文
posted @ 2015-09-16 12:33 java后端领域 阅读(1736) 评论(0) 推荐(0) 编辑
摘要: 版本:4.1带参数名的情况 HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url);// httpPost.setHeader("Accept-Encoding", ... 阅读全文
posted @ 2015-08-05 11:16 java后端领域 阅读(8891) 评论(0) 推荐(0) 编辑
摘要: HttpResponse response = httpClient.execute(httpPost); //对zip进行解压 response.setEntity(new GzipDecompressingEntity(response.getEntity()));//在这里特殊处理一下就行 ... 阅读全文
posted @ 2015-07-31 10:42 java后端领域 阅读(855) 评论(0) 推荐(0) 编辑
摘要: 例子:$.ajax({ type: 'POST', url: "/ROOT/modify.do", contentType: "application/json",//如果想以json格式把数据提交到后台的话,这个必须有,... 阅读全文
posted @ 2015-05-11 22:08 java后端领域 阅读(6891) 评论(0) 推荐(0) 编辑
摘要: 1.Linux杀进程的一个例子(1)查看进程:ps -ef | grep 进程名(2)杀进程:kill -9 进程名或者进程号例如:杀tomcat的进程(1)ps -ef | grep tomcat(2)根据上一步得到的进程号,kill -9 进程号参数解说:(1)查询进程命令:ps 表示查询进程的... 阅读全文
posted @ 2015-04-21 10:25 java后端领域 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 背景:把两个项目同时部署在tomcat,启动快好的时候,报java.lang.OutOfMemoryError: PermGen space原因:因为两个项目的jar包太多,JVM把里面的class文件加载时把默认的内存撑爆了解决方法:(1)查找了很多网上的方法,但是还是解决不了我的问题。我的解决方... 阅读全文
posted @ 2015-04-02 20:34 java后端领域 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 备注:这个是基于搭建好spring的环境下的注解方式:1.定时任务类package com.test;import java.util.Date;import org.springframework.scheduling.annotation.Scheduled;import org.springf... 阅读全文
posted @ 2015-03-30 16:26 java后端领域 阅读(532) 评论(0) 推荐(0) 编辑
摘要: 1.将日期的字符串格式转为特定的字符串日期格式:例如:2014-12-12 21:33:11转为2014年12月12日 21时33分11秒(1)代码:/** * * @author lisheng90777 *步骤: *1.将日期的字符串转为Date日期格式的对象 *2.利用日期格式化格式器Sim... 阅读全文
posted @ 2015-02-08 17:17 java后端领域 阅读(490) 评论(0) 推荐(0) 编辑
摘要: 1.run 方法与start方法的区别(1)start方法:开启线程并执行run方法的代码(2)run方法:仅仅是对象调用方法,而线程创建了,并没有运行。//单线程例如:下面的代码 1 public class MyThread extends Thread{ 2 3 private ... 阅读全文
posted @ 2015-02-08 16:57 java后端领域 阅读(203) 评论(0) 推荐(0) 编辑