controller .java
android:calenderViewShown="false"
的javascript
@RequestMapping(value = "searchbook", method = RequestMethod.POST, produces = "text/plain")
public @ResponseBody String myController(HttpServletRequest request) throws SQLException {
String myItem = request.getParameter("searchid");
PostgrConnect db = new PostgrConnect();
ResultSet rs;
Book book = new Book();
try {
rs = db.getData("select * from mt_book where book_id='" + myItem + "'");
while (rs.next()) {
book.setBook_id(rs.getString("book_id"));
book.setBook_title(rs.getString("book_title"));
book.setAuthor_name(rs.getString("author_name"));
book.setPublisher(rs.getString("publisher"));
book.setPublication_day(rs.getString("publication_day"));
}
} catch (Exception e) {
e.printStackTrace();
System.out.println(e);
}
return book.getBook_id() + ";" + book.getBook_title() + ";" + book.getAuthor_name() + ";" + book.getPublisher()
+ ";" + book.getPublication_day();
}
我可以从数据库中获取数据:
但是当传递给javascript时: