问题描述:
在A.JSP中有一个超级链接 <a href="b.jsp?teamid=1008">update</a>,点击以后跳转到B.JSP中.然后地址栏中显示 .../b.jsp?teamid=1008 . 在B.JSP中使用JSP语句
<%
String tid = request.getParameter("teamid");
if (tid == null)
out.println("error");
%>问题: 我为什么取不到teamid的值呢?
在A.JSP中有一个超级链接 <a href="b.jsp?teamid=1008">update</a>,点击以后跳转到B.JSP中.然后地址栏中显示 .../b.jsp?teamid=1008 . 在B.JSP中使用JSP语句
<%
String tid = request.getParameter("teamid");
if (tid == null)
out.println("error");
%>问题: 我为什么取不到teamid的值呢?
解决方案 »
- 谷歌浏览器异常 cannot call method 'open' of undefined
- JAVA做的 一个很不错的 开心001 超级大亨辅助工具 撒分咯~
- 关于Ant 等
- 请大家给我解释一下在java方法中定义的参数,是用外覆类好 ,还是用基本类型那个数据好?
- 我是新手,问个TOMCAT的问题(对不起大家,我的分都没了)
- jsp中用jstl访问数据库好还是用servlet好
- 关于apache数据源BasicDataSource的参数问题
- JSP访问oracle数据库问题
- 急,jsp数据库连接问题,急,在线等!!!
- 求mysql和tomcat发布的资料
- 高手帮我优化一下这个数据库连接bean
- 在网站系统中怎么实现登录用户之间发消息呢
分大小写的,页面能够打开??
不需要在A.jsp中写出POST方法吗?
还有tid == null好像没什么用吧 应该改为tid.equals("")
试试,没问题
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<jsp:useBean id="et" class="dbOperation.connSql" scope="page"></jsp:useBean><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Update Expert Team Infomation</title>
</head>
<body style="font-family: Arial; font-size: small; font-weight: bolder">
<table width="778" align="center">
<tr>
<td background="images/fba_01.jpg" height="125"></td>
</tr>
<tr>
<td background="images/etbg.jpg" height="50"></td>
</tr>
</table>
<table width="778" align="center">
<tr>
<td align="left" style="border: ; color: blue; font-family: Arial; font-size: medium; font-weight: bold">Team Leader</td>
</tr>
</table><form name="frm1" action="AddExpertTeam.jsp" method="post">
<input type="hidden" name="teamid" value="<%=request.getParameter("teamid") %>">
<input type="hidden" name="update" value="1">
<table width="600" align="center" style="border: 1 solid #0000a0">
<%
et.connectDB("brtc1","brtc","");
String tid = request.getParameter("teamid");
if (tid == null)
out.println("no team id");A.JSP中不是链接,写错了,是一个JAVASCRIPT的函数:代码如下:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="prj" class="dbOperation.connSql" scope="page"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Update Project Infomation</title>
</head>
<script language="javascript">
function upExp(id)
{
window.open("updateExpertTeam.jsp?teamid="+id,"UpdateExpertTeam","menubar,statusbar,location,scrollbar,resizable=yes");
}
function upStaff(id)
{
window.open("updateStaffTeam.jsp?teamid="+id,"UpdateStaffTeam","menubar,statusbar,location,scrollbar,resizable=yes");
}
</script>
都用GBK试试.
String tid =(String)request.getParameter("teamid");