try {
PaperDAOImpl objPaperDAOImpl = new PaperDAOImpl();
AuthorDAOImpl objAuthorDAOImpl = new AuthorDAOImpl();
List<papersBean> listPaperBean = new ArrayList<papersBean>();
List<List<Author>> listOfListAuthor = new ArrayList<List<Author>>();
String title = null;
String author = null;
if (request.getParameter("searchtitle") != null) {
title = request.getParameter("title").trim();
if (title.trim().equals("")) {
String error = " You must choice option search";
request.setAttribute("error", error);
} else {
listPaperBean = objPaperDAOImpl.SearchPaperByTitle(title
.trim());
request.setAttribute("listresult", listPaperBean);
// Get List Author Name , List
if (!listPaperBean.isEmpty()) {
for (int i = 0; i < listPaperBean.size(); i++) {
List<Author> listAuthor = objAuthorDAOImpl
.GetListAuthorByIdPaper(listPaperBean
.get(i).getIdPaper());
if (listAuthor != null) {
listOfListAuthor.add(listAuthor);
}
}
int size = 0; // for debug
size = listOfListAuthor.size(); // for debug
request.setAttribute("lolAuthor", listOfListAuthor);
RequestDispatcher rd = request
.getRequestDispatcher("front-end/search.jsp");
rd.forward(request, response);
return;
}
}
}
} catch (ServletException e) {
e.printStackTrace();
}
finally {
}
这是用于搜索数据的 MyServlet。
当我调试到 util 行时:
`RequestDispatcher rd = request.getRequestDispatcher("front-end/search.jsp");`
一切还好。并且 "listOfListAuthor" , "listPaperBean"
有数据......但是当调试到 row 时:
rd.forward();
---> 我有一个问题我仍然无法解决。
**Aug 19, 2012 3:48:52 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
at managerpapers.system.servletController.FESearchTitle.processRequest(FESearchTitle.java:73)--This is rows : `rd.forward()`;**
这是用于搜索数据的 MyServlet!我为此调试了一整天。这是我的论文。A 不了解 servlet master 。有人有什么主意吗 ?
这是用于搜索数据的 MyServlet!我为此调试了一整天。这是我的论文。A 不了解 servlet master 。有人有什么主意吗 ?