摘要: 在此使用firebug进行操作:打开firebug的“网络”标签,并激活该功能。然后在注册页面中输入手机号码后点击发送。然后在面板中可以发现发送信息的链接,查看使用get还是post方式获取,并点击该标签,得到各个参数信息和源代码(请求的参数),在java中模拟发送post或者get请求即可。 阅读全文
posted @ 2013-08-16 17:09 无忧之路 阅读(319) 评论(0) 推荐(0) 编辑
摘要: SSH hibernate 使用时最好添加访问数据库的编码如下所示:第13行为设置hibernate访问数据库的编码(&是&的转义序列) 1 4 5 6 7 8 9 10 com.mysql.jdbc.Driver11 12 13 jdbc:mysql://localhost:3306/hibernatetest?useUnicode=true&characterEncoding=UTF-814 15 root16 ... 阅读全文
posted @ 2013-08-06 21:58 无忧之路 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Hibernate关于sql中的count(*)数据统计:①如果使用的是HQL:直接在HQL中使用count(*)即可获取行数 Long count = (Long)HibernateUtil.getSession() .createQuery("select count(*) from Employee") .uniqueResult(); System.out.println(count); ②如果使用的是Criteria方式查询:使用Projections.rowCount()方法 ... 阅读全文
posted @ 2013-08-06 21:22 无忧之路 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: JDK5以后Integer a = 3; 这是自动装箱int i = new Integer(2); 这是自动拆箱就是基本类型和其对应的包装类型在需要的时候可以互相转换,具体过程由编译器完成比如自动装箱:Integer a=3;其实编译器调用的是static Integer valueOf(int i)这个方法查阅JDK知道,valueOf(int i)返回一个表示指定的int 值的Integer 对象那么就变成这样: Integer a=3; => Integer a=Integer.valueOf(3);对应的 int intValue() 返回该Integer对象的int值,是拆箱 阅读全文
posted @ 2013-08-06 00:20 无忧之路 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 这是一个文件下载的action,红色部分为火狐浏览器需要特地做的事情。@Controller@Scope(value = "prototype")public class FormManage_downloadAction { private String fileName;//下载文件时候的名称 private String filePath;//文件在磁盘的路径 public String execute() throws UnsupportedEncodingException { System.out.println("下载action"); . 阅读全文
posted @ 2013-08-05 22:41 无忧之路 阅读(571) 评论(0) 推荐(0) 编辑
摘要: /formManage/download.do?filePath=${filePath}&fileName=${fileName} 红色部分即“&”符号,因为xml中转义问题(& -> &)所以传参的时候要注意了 阅读全文
posted @ 2013-08-05 13:23 无忧之路 阅读(808) 评论(0) 推荐(0) 编辑
摘要: IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下所示:import com.lowagie.text.*;import com.lowagie.text.Font;import com.lowagie.text.Rectangle;import com.lowagie.text.pdf.BaseFont;import com.lowagie.text.pdf.PdfPCell;import com.lowagie.text.pdf.PdfPTable;import com.lowagie. 阅读全文
posted @ 2013-08-04 19:21 无忧之路 阅读(796) 评论(0) 推荐(0) 编辑
摘要: IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下:import com.lowagie.text.*;import com.lowagie.text.Rectangle;import com.lowagie.text.rtf.RtfWriter2;import java.io.FileOutputStream;/** * 纸张方向横向测试 * User: HYY * Date: 13-8-1 * Time: 下午9:54 * To change this template use File 阅读全文
posted @ 2013-08-04 19:17 无忧之路 阅读(909) 评论(0) 推荐(1) 编辑
摘要: 昨晚寻找了网上很多关于IText表格居中问题,他们其中的有些代码我即使复制上去生成的doc表格的文字都是不居中的,后来我自己找出了一种居中方式:为PdfPCell对象添加paragraph对象,并将该paragraph设置为居中: PdfPCell cell1 = new PdfPCell(); Paragraph para = new Paragraph("该单元居中"); //设置该段落为居中显示 para.setAlignment(1); cell1.setPhrase(para); table.addCell(cell1);代码亲测无误,全部代码如下:import 阅读全文
posted @ 2013-08-04 19:14 无忧之路 阅读(18817) 评论(0) 推荐(1) 编辑
摘要: IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下:import com.lowagie.text.Document;import com.lowagie.text.Font;import com.lowagie.text.PageSize;import com.lowagie.text.Paragraph;import com.lowagie.text.pdf.BaseFont;import com.lowagie.text.rtf.RtfWriter2;import org.junit. 阅读全文
posted @ 2013-08-04 19:01 无忧之路 阅读(781) 评论(0) 推荐(1) 编辑
无忧之路