部分代码:
if(!isEmpty(voyageId)){c.add(Expression.like("voyage.code", "%"+voyageId+"%"));
m.put("voyageId", "voyage.code");
}
if(!isEmpty(pod)){
c.add(Expression.like("pod.id", "%"+pod+"%"));
m.put("pod", "pod.id");
}
if(!isEmpty(pol)){
logger.debug("Search - Add condition for pol");
c.add(Expression.like("pol.id", "%"+pol+"%"));
m.put("pol", "pol.id");
}
List result = c.list(); -------------->执行到这抛异常
if(result.size()>0){
request.setAttribute("voList", result);
} endTransaction(false);
request.setAttribute("voList", result);
return mapping.findForward("main");
if(!isEmpty(voyageId)){c.add(Expression.like("voyage.code", "%"+voyageId+"%"));
m.put("voyageId", "voyage.code");
}
if(!isEmpty(pod)){
c.add(Expression.like("pod.id", "%"+pod+"%"));
m.put("pod", "pod.id");
}
if(!isEmpty(pol)){
logger.debug("Search - Add condition for pol");
c.add(Expression.like("pol.id", "%"+pol+"%"));
m.put("pol", "pol.id");
}
List result = c.list(); -------------->执行到这抛异常
if(result.size()>0){
request.setAttribute("voList", result);
} endTransaction(false);
request.setAttribute("voList", result);
return mapping.findForward("main");
这个值是空的。,所以会报例外。。
List result = c.list();
这个值是空的。,所以会报例外。。
***********************************
谢谢,我再检查一下.
Object object=(Object)result.get(i);
if(object!=null)
Sysetem.out.println(object.getId());}