奋斗的小牧童
2015-04-21 20:03
<%@page import="entity.items"%> <%@page import="dao.itemsDAO"%> <%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>商品详情页</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <style type="text/css"> div{ float:left; margin-left: 30px; margin-right:30px; margin-top: 5px; margin-bottom: 5px; } div dd{ margin:0px; font-size:10pt; } div dd.dd_name { color:blue; } div dd.dd_city { color:#000; } </style> </head> <body> <h1>商品详情</h1> <hr> <center> <table height="750" width="60" cellpadding="0" cellspacing="0" border="0" > <tr> <% itemsDAO itemdao = new itemsDAO(); items item = itemdao.getitemsById(Integer.parseInt(request.getParameter("id"))); if(item!=null) { %> <td width="70%" valign="top"> <table> <tr> <td rowspan="4"><img src="images/<%=item.getPicture() %>" width="200" height="160" /> </td> </tr> <tr> <td><B><%=item.getName() %></B></td> </tr> <tr> <td>地址:<%=item.getCity() %></td> </tr> <tr> <td>价格:<%=item.getPrice() %></td> </tr> </table> </td> <% } %> </tr> </table> </center> </body> </html>
请问我也是取不到值,怎么回事,能否告知一下。
items item = itemdao.getitemsById(Integer.parseInt(request.getParameter("id")));
确定id的值是存在request里了吗
最好贴一下其他代码
JAVA遇见HTML——JSP篇
248279 学习 · 3125 问题
相似问题