加载详情功能(带外键查询)
jsp1界面
传递参数recipe_no,访问servlet*
<a target="_top" href="<c:url value='/RecipeServlet?method=load&recipe_no=${recipe.recipe_no}'/>">
<img style="width: 296px" height="220px" src="<c:url value='/${recipe.recipe_photo}'/>">
</a>
javabean
private String recipe_no;
private String recipe_name;
private User user;
dao.java*
通过参数recipe_no访问数据库,将结果集封装到一个map里
public Map<String, Object> findByRecipe_no(String recipe_no) {
try {
String sql="select * from recipe,user where recipe.userno=user.userno and recipe_no=?";
Map<String, Object> map =qr.query(sql, new MapHandler(),recipe_no);
return map;
} catch (S