放个hidden控件--->name:hiddenvalue
然后和获得参数一样得到就是:request.getParamter("hiddenvalue")
然后和获得参数一样得到就是:request.getParamter("hiddenvalue")
解决方案 »
- struts2的配置,如何配properties文件呢
- 为什么要用Spring?
- 倾其所有积分,求图片上传至服务器核心代码.s2sh2+ajax+jquery的项目
- 关于ExcelFileUtils中导出excel表格应用
- 删除时为何报“attempt to create delete event with null entity”
- 怎样通过一个链接打开.wma文件?????
- 两个jsp页面传值的问题,求解
- 能不能用servlet删除硬盘上的文件??
- 超链接中如何实现此种传递中文?(servlet实现接收)
- 购买jsp虚拟主机,发现没有选择
- 分数只给3位有效信息提供者
- 500分求jsp+mssql或jsp+access论坛原码(不要mssql)
<INPUT TYPE="button" value="OK" onclick="to();"><SCRIPT LANGUAGE="JavaScript">
<!--
function to(){
document.form1.jspStr.value = "TEST"; alert(document.form1.jspStr.value);
}
//-->
</SCRIPT>
我也知道,但怎么取呢,用request.getParamter("hiddenvalue");取的是null
<%@page import="java.sql.*"%>
<%@page import="java.io.*"%>
<html>
<head>
<title></title>
<head>
<body>
<script>
function shanchu(values)
{
with(document.thisform)
{
sjkm.value=values;
action=shuchu.jsp;
submit();}
}
</script>
<%!Connection conn = null; %>
<%!Statement stmt = null; %>
<%!ResultSet RS=null;%>
<%!String sql=null;%>
<%!String[] CName;%>
<%!String[] sj;%>
<%!ResultSetMetaData metaData;%>
<%String bm=request.getParameter("T1");%>
<%=bm%>
<form name="thisform" method="post" onsubmit="shuchu.jsp">
<input type="hidden" name="sjkm">
<%
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost/mms", "root","");
stmt = conn.createStatement();
sql="select * from "+ bm;
RS = stmt.executeQuery(sql);
metaData=RS.getMetaData();
int number=metaData.getColumnCount();
CName=new String[number];
%>
<table width="100%" border="5">
<tr>
<%for (int i=0;i<number;i++){
CName[i]=metaData.getColumnLabel(i+1);%>
<th> <%=CName[i]%></th>
<% }%>
</tr>
<%sj=new String[number];%>
<tr>
<%while (RS.next()){%>
<tr>
<%for(int i=0;i<number;i++){
sj[i]=RS.getString(CName[i]);%>
<th><%=sj[i]%></th>
<%}%>
<th><a href="javascript:shanchu('<%=sj[0]%>');" class="a_red">删除</th>
</tr>
<%}RS.close();
stmt.close();
%>
</tr>
</table>
</form>
<%String tablename=request.getParameter("sjkm");%>
<%=tablename%>//取hidden的值
</body>
</html>
我可能写错了,希望高手改一下
<th><a href=shuchu.jsp?sjkm=<%=sj[0]%> >删除</th>