日期:2014-05-20 浏览次数:20941 次
ArrayList tt=new ArrayList(); tt.add("a"); tt.add("b"); tt.add("c"); System.out.println("测试:"+tt); request.setAttribute("tt", tt);
SysUser user = (SysUser) request.getSession().getAttribute(Globals.USER_KEY); String sfs=user.getSfs(); String orgno=user.getOrgno(); String username=user.getUsername(); String condition =null; Connection conn = DBUtil.getConnection(); if (orgno.equals("21000002")&&(sfs.equals("") || (sfs==null)) ) { //当前user是监狱 System.out.println("1"); condition ="where to_sifasuo='"+username+"'and sfs is not null"; }else if (orgno.equals("21000003")&& (sfs.endsWith("司法所")||sfs.equals("农委"))) { //当前user是司法所 condition ="where (to_jianyu='"+username+"'or to_jianyu is null )and sfs is null"; } ArrayList al=new ArrayList(); Statement stmt=null; ResultSet rs=null; Tb_newTaskVo voo = null; String sql = "SELECT RWBT , YWLX , LYDW , LRY , BLSJ , URL FROM Tb_NewTask"+" "+condition; System.out.println(sql); //System.out.println(condition); try { stmt=conn.createStatement(); //System.out.println("1"); rs=stmt.executeQuery(sql); //System.out.println("2"); while(rs.next()){ voo = new Tb_newTaskVo(); voo.setrwbt(rs.getString(1)); voo.setywlx(rs.getString(2)); voo.setlydw(rs.getString(3)); voo.setlry(rs.getString(4)); voo.setblsj(rs.getDate(5)); voo.seturl(rs.getString(6)); al.add(voo); } } catch (Exception e) { conn.rollback(); e.printStackTrace(System.out); Pub.writeXmlErrorMessage(response, this.handleError(e)); } finally{ try { rs.close(); stmt.close(); if (conn != null) { conn.close(); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(System.out); } } request.getSession().setAttribute("list", al); //request.setAttribute("list", al); ArrayList tt=new ArrayList(); tt.add("a"); tt.add("b"); tt.add("c"); System.out.println("测试:"+tt); request.setAttribute("tt", tt); request.getRequestDispatcher("/jsp/framework/newblueTemplate/task.jsp").forward(request, response); //System.out.flush(); //System.out.close(); //System.out.println(al); System.out.println("sql条件语句:"+condition+"**********************"); return null;