`
My_Imagination
  • 浏览: 13677 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
import java.util.Random; public class TestRandom { public static Random r = new Random(); public static String getRandom(){ long num = Math.abs(r.nextLong() % 10000000000L); String s = String.valueOf(num); for(int i = 0; i < 10-s.length(); i++ ...
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Mapping file autogenerated by MyEclipse Persiste ...
Action层:   public class LoginAction { private ISysUserBiz sysUserBiz; private SysUser sysUser; public String doLogin() { System.out.println("进入doLogin()方法"); sysUser = sysUserBiz.findUser(sysUser.getUsrName(), sysUser .getUsrPassword()); if (sysUser == null) { ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; c ...
web.xml配置: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee h ...
导入json包,然后用JSONArray.fromObject();,可以得到JSONArray类型的对象,这就是json格式的对象数组。 我简单的写了一个,也是用List,转换成Json形式后输出: List<Book> list = new ArrayList<Book>(); list.add(new Book(1L,"abc1","jame5")); list.add(new Book(2L,"abc3","jame3")); JSONArray json = JSONArray. ...
1、引入包(本文中的包全部引自struts-2.1.8.1\lib): struts2-json-plugin-2.1.8.1.jar json-lib-2.1.jar commons-collections-3.2.jar commons-beanutils-1.7.0.jar commons-lang-2.3.jar commons-logging-1.0.4.jar ezmorph-1.0.3.jar 这7个包是返回json形式的数据必须的。因为json大量引用了Apache commons的包,所以要加入4个,commons包,除了commons的包外,还需要引入一个 ez ...
Global site tag (gtag.js) - Google Analytics