入口代码
@At("addbook")
@Ok(">>:querybook")
public boolean addbook(HttpServletRequest request){
Book book=new Book();
book.setName(request.getParameter("name"));
book.setUserId(Integer.parseInt(request.getParameter("userId")));
Book insert = dao.insert(book);
if(insert==null){
return false;
}
return true;
}
jsp代码
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<form>
<c:forEach items="${books}" var="book">
<div>书名${book.name}</div>
<a href=">>:deletebook">删除图书</a>
<a href="update.jsp">修改图书</a>
</c:forEach>
<a href="toaddbook?userId=${book.userId}">添加</a>
</form>
</body>
</html>
问答
我在book中存入了userId,为什么入口拿不到jsp传过来的那个id,求大神指教
标签:
无
添加回复
请先登陆