81,094
社区成员
发帖
与我相关
我的任务
分享
2009-09-22 14:38:35,125 WARN [http-8082-4] (RequestProcessor.java:528) WARN - Unhandled Exception thrown: class java.lang.NullPointerException
2009-9-22 14:38:37 org.apache.catalina.core.ApplicationContext log
信息: java.lang.NullPointerException
public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
ServicesForm servicesForm = (ServicesForm) form;
String names = request.getParameter("names");
DetachedCriteria dc = DetachedCriteria
.forClass(Services.class);
if (names != null && !names.equals("")) {
dc.add(Restrictions.like("names", names,
MatchMode.ANYWHERE));
}
List list = SpeakforServingService.getAll(dc);
int totalrow = list.size();
int perpagerow = servicesForm.getPerpagerow();
int currentpage = servicesForm.getCurrentpage();
if (currentpage == 0) {
servicesForm.setCurrentpage(1);
}
int start = (currentpage - 1) * perpagerow;
List pageList = SpeakforServingService.findPageList(dc,
start, perpagerow);
servicesForm.setTotalrow(totalrow);
request.setAttribute("servicesList", pageList);
request.setAttribute("servicesForm", servicesForm);
request.setAttribute("names", names);
return mapping.findForward("toSpeakfor");
}
}