java 基础常用知识

1,action中传数组对象
request.setAttribute("m",m); 在jsp页面取值 String m[]=(String[])request.getAttribute("m");
2,判断一个list是否有值 list.size()>0;

3,标签 <c:set var="add" value="1"/>,  <c:forEach items="${progressList}" var="progressList">,<c:if test="${j%7==0&&j>0}"> ,<%@include file="tradecontract_common.jsp"%>

4,jsp页面导入java包。<%@page import="gnnt.MEBS.common.front.common.PageRequest"%>

5,List和map结合使用。

 List<Map<Object, Object>> list = this.getService().getListBySql( " select * from E_PICAGENT p where p.picid='" + picID + "'");

if (list != null && list.size() > 0) {
   Map<Object, Object> map = list.get(0);
   String s = (String) map.get("AGENTPICID");
   request.setAttribute("agentPicID", s);
  }

6.类型转换

 Long.parseLong(s);//Stirng 转化成long
Integer.parseInt(s);//Stirng 转化成int

7,访问地址参数设置http://localhost:8080/tewt/webAction!add?a=4&b=3;

猜你喜欢

转载自244639521.iteye.com/blog/2113592