不好意思,我试了<a href="Edit.jsp?ID=<%=TasID%>)">这句话,但是提示我错误: org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 30 in the jsp file: /zhcx.jspGenerated servlet error: [javac] Compiling 1 source fileC:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\zhcx_jsp.java:86: cannot resolve symbol symbol : variable TasID location: class org.apache.jsp.zhcx_jsp out.print(TasID); ^ 1 error 请教,是什么愿意?
<form name="form1" method="post" action="view.jsp">
<p><center>
<table border="1" cellpadding="0" cellspacing="0">
<%
Class.forName.....
Connection con.......
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select ........
while(rs.next()){
%>
<tr>
<td><%=rs.getString("xingming")%></td>
<td><%=rs.getString("zhanghao")%></td>
<td><%=rs.getString("mima")%></td>
<td><%=rs.getString("suoshudanwei")%></td>
<td><input name="submit" type="submit" value="修改"></td>
</tr>
<%}//end while
//clear up.
.....
%>
</table>
</center>
</p>
</form>
或者直接把“修改”做成超链接传递id号,不用form
也可以<input name="hidden" type="hidden" value=<%rs.getSting("id")%>></td>.这个我没测试,感觉应该行。
out.print("<tr height='23'><td><li><a href=article.jsp?id="+getStr(pageBeginDate));
out.print(">"+getStr(pageBeginDate)+"</a></td><td>"+getStr(stra)+"</td></tr>");
用上面的显示数据方式了代替你的方式。
<tr>
<td><%=rs.getString("xingming")%></td>
<td><%=rs.getString("zhanghao")%></td>
<td><%=rs.getString("mima")%></td>
<td><%=rs.getString("suoshudanwei")%></td>
<td><input name="submit" type="submit" value="修改"></td>
</tr>将表的唯一识别号传到下一个页面中,然后据此识别号取记录数据显示,并可修改。
<a href="Edit.jsp?ID=<%=TasID%>)">修改</a> // 利用这种方式转到Edit.jsp页面后读ID这个参数就可以拉
里:1、“?”是表示什么?
2、在edit.jsp中ID该怎样读?
对不起,我是初学者,请指教。能详细一点吗?
2、在edit.jsp中可以通过request.getParamenter("ID")来读
org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 30 in the jsp file: /zhcx.jspGenerated servlet error:
[javac] Compiling 1 source fileC:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\zhcx_jsp.java:86: cannot resolve symbol
symbol : variable TasID
location: class org.apache.jsp.zhcx_jsp
out.print(TasID);
^
1 error
请教,是什么愿意?
2、<%=TasID%>)中的TasID是什么意思?是系统默认的函数?