- 浏览: 13677 次
- 性别:
- 来自: 武汉
最新评论
文章列表
Java随机产生10位长度的字符串
- 博客分类:
- Java
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++ ...
Hibernate映射文件及实体类、Dao实现
- 博客分类:
- web开发
<?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 ...
SSH的简单应用说明
- 博客分类:
- web开发
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) {
...
去掉下拉框的边线和三角箭头及隐藏或禁用下拉框
- 博客分类:
- html
<!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 ...