在将页面导向另一页面,用的是, 但在传入参数时,中是获得代表参数的名

bluesky006516 2003-10-15 12:39:33
如:<a href="..jsp?fatherid=<%=id_father%>">
但获得的就是id_father,而不是他的植,这是怎么回事啊????
急死我了
...全文
34 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
songfrh 2003-10-15
  • 打赏
  • 举报
回复
<a href=..jsp?fatherid=<%=id_father%>>
007james 2003-10-15
  • 打赏
  • 举报
回复
你确信你运行了jsp程序吗?
这样试试:
<a href='..jsp?fatherid=<%=id_father%>'>

或者这样试试他的值
<%
string temp = id_father;
out.println(id_father);
%>
<a href='..jsp?fatherid=<%=temp%>'>

bluesky006516 2003-10-15
  • 打赏
  • 举报
回复
我肯定是运行了,代码如下:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="merp.common.util.*" %>
<%@ page import="merp.sc.server.dba.common.*" %>
<%@ page import="java.sql.*"%>
<html>
<head>
<title>
lanmushezhi
</title>
</head>

<body>
<%
DBA dba=null;
Connection conn=null;
dba = new DBA(ActiveConnection.SQL_TYPE_MYSQL);
conn=dba.initDBA(null);
String sql="select * from sd_productkind";
String [][] str=dba.loadDataFromDB(conn,sql,1,5,false);//连数据库,返回数蛛
%>
<table>
<tr>
<td>类别名</td>
<td width="60%">操作</td>
</tr>
<%
for(int i=0;i<str.length;i++)
{
out.printlnln("<tr><td>");//需要分页
out.printlnln(str[i][1]);
out.printlnln("</td>");
out.printlnln("<td>");
out.println("<a href='addlanmu.jsp?fatherid=" + str[i][0] + "'>添加子类");
out.println("</a>");
out.println("</td>");
out.printlnln("<td>");
out.println("<a href='xianshilanmu.jsp?lanmuid="+ str[i][0]+"'>显示");
out.println("</a>");
out.println("</td>");
out.println("<td>");
out.println("<a href='dellanmu.jsp?lanmuid="+str[i][0]+"'>删除");
out.println("</a>");
out.println("</td>");
}
dba.closeDBA(conn);
%>
</table>
</body>
</html>
xiaoganba 2003-10-15
  • 打赏
  • 举报
回复
应该是这样写:<a href='..jsp&fatherid=<%=temp%>'>
...
aku0708 2003-10-15
  • 打赏
  • 举报
回复
应该没问题吧,你看是不是别的地方有错

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧