所有非byte类型的基本类型都可以通过String.valueOf() 方法来转换为字符串
非基本类型的比较需要使用equals方法
取得表单提交的参数值
1: String name = request.getParameter(Name); 取得表单提交的数组值
1: String[] nameList = request.getParameterValues(ListName); 向页面传递参数
1: request.setAttribute(var,value); Session操作
1: session.setAttribute(var,value);
2: session.getAttribute(var);
3: session.removeAttribute(var); 把字符串分割为数组
1: String[] col= MyStr.split(,); 判断数组的长度
1: MyList.length; 1: Integer.parseInt(Str); 在JSP页面中输出传递值
1: <bean:write name=Obj property=Id /> //对象的某个属性
2: <bean:write name=name /> Map操作方法
1: Map condition= new HashMap();
2: condition.put(name, value);
3: condition.get(name); 日期格式化
1: Date date= new Date();
2: SimpleDateFormat df= new SimpleDateFormat(yyyy-MM-dd);
3: String today = df.format(date); //把日期型转换为字符串
4: Date day = df.parse(2005-08-09); 动态字符串方法 StringBuffer buffer= new StringBuffer(100);
下面两个算是比较高级的使用了
日期相减的方法
1: import java.util.*;
2: public class DateSubtraction