p_look.jsp<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统页面</title>
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style></head><body>
<jsp:useBean id="Pbean" scope="page" class="sciencedata.Person.PersonForm"/>
<jsp:useBean id="Ubean" scope="page" class="sciencedata.UserForm"/><% String name=request.getParameter("name");
out.print(name); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbc:odbc:lj";
Connection conn=DriverManager.getConnection(url);
Statement stmt=stmt=conn.createStatement(); //Bean.Connect("lj");
String t_id=request.getParameter("t_id");
String t_name=Pbean.getT_name();
String b_date=Pbean.getB_date();
String d_identity=Pbean.getD_identity();
String degree=Pbean.getDegree();
String e_mail=Pbean.getE_mail();
String f_language=Pbean.getF_language();
String g_school=Pbean.getG_school();
String g_time=Pbean.getG_time();
String mobile=Pbean.getMobile();
String p_note=Pbean.getP_note();
String phone=Pbean.getPhone();
String post=Pbean.getPost();
String qq=Pbean.getQq();
String sect=Pbean.getSect();
String sex=Pbean.getSex();
String x_ray=Pbean.getX_ray(); String sqlstr = "select * from [person] where t_name in (select name from [user] where name="+"'"+name+"')";
ResultSet rs=stmt.executeQuery(sqlstr);
if(rs.next()) { t_id = rs.getString("t_id");
t_name = rs.getString("t_name");
sex=rs.getString("sex");
d_identity = rs.getString("d_identity");
post=rs.getString("post");
degree=rs.getString("degree");
x_ray=rs.getString("x_ray");
g_school=rs.getString("g_school");
g_time=rs.getString("g_time");
f_language=rs.getString("f_language");
mobile=rs.getString("mobile");
phone=rs.getString("phone");
qq=rs.getString("qq");
e_mail=rs.getString("e_mail");
p_note=rs.getString("p_note");
b_date=rs.getString("b_date");
sect=rs.getString("sect");
}%> <table width="650" height="500" border="1" align="center" bgcolor="#FFFFFF">
<tr>
<td width="150" valign="top">
<table width="150" height="500" border="1">
<tr>
<th width="150" height="25">ID:</th>
</tr>
<tr>
<th height="25">姓名:</th>
</tr>
<tr>
<th width="150" height="25">性别:</th>
</tr>
<tr>
<th height="25">出生年月:</th>
</tr>
<tr>
<th height="25">身份证号:</th>
</tr>
<tr>
<th height="25">部门:</th>
</tr>
<tr>
<th height="25">职称:</th>
</tr>
<tr>
<th height="25">学位:</th>
</tr>
<tr>
<th height="25">学历:</th>
</tr>
<tr>
<th height="25">毕业学校:</th>
</tr>
<tr>
<th height="25">毕业时间:</th>
</tr>
<tr>
<th height="25">外语级别:</th>
</tr>
<tr>
<th height="25">手机号码:</th>
</tr>
<tr>
<th height="25">小灵通号:</th>
</tr>
<tr>
<th height="25">QQ号:</th>
</tr>
<tr>
<th height="25">邮箱:</th>
</tr>
<tr>
<th height="100">备注:</th>
</tr>
</table></td>
<td width="500" valign="top"> <table width="500" height="500" border="1">
<tr>
<td height="25">
<%out.print(t_id);%>
</td>
</tr>
<tr>
<td height="25">
<%=t_name%>
</td>
</tr>
<tr>
<td height="25">
<%=sex%>
</td>
</tr>
<tr>
<td height="25">
<%=b_date%>
</td>
</tr>
<tr>
<td height="25">
<%=d_identity%>
</td>
</tr>
<tr>
<td height="25">
<%=sect%>
</td>
</tr>
<tr>
<td height="25">
<%=post%>
</td>
</tr>
<tr>
<td height="25">
<%=degree%>
</td>
</tr>
<tr>
<td height="25">
<%=x_ray%>
</td>
</tr>
<tr>
<td height="25">
<%=g_school%>
</td>
</tr>
<tr>
<td height="25">
<%=g_time%>
</td>
</tr>
<tr>
<td height="25">
<%=f_language%>
</td>
</tr>
<tr>
<td height="25">
<%=mobile%>
</td>
</tr>
<tr>
<td height="25">
<%=phone%>
</td>
</tr>
<tr>
<td height="25">
<%=qq%>
</td>
</tr>
<tr>
<td height="25">
<%=e_mail%>
</td>
</tr>
<tr>
<td height="100" valign="top">
<%=p_note%>
</td>
</tr>
</table></td>
</tr>
<tr align="center">
<td height="25" colspan="2"><a href="main.jsp">返回</a></td>
</tr>
</table>
</body>
</html>
引入的bean就是连个ActionForm,我的想法是你再页面输入的值不是保存在form离了吗,为什么name不能获得到值了,是不是要session什么的,我菜鸟,初学者,尽量说具体点,谢谢
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统页面</title>
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style></head><body>
<jsp:useBean id="Pbean" scope="page" class="sciencedata.Person.PersonForm"/>
<jsp:useBean id="Ubean" scope="page" class="sciencedata.UserForm"/><% String name=request.getParameter("name");
out.print(name); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbc:odbc:lj";
Connection conn=DriverManager.getConnection(url);
Statement stmt=stmt=conn.createStatement(); //Bean.Connect("lj");
String t_id=request.getParameter("t_id");
String t_name=Pbean.getT_name();
String b_date=Pbean.getB_date();
String d_identity=Pbean.getD_identity();
String degree=Pbean.getDegree();
String e_mail=Pbean.getE_mail();
String f_language=Pbean.getF_language();
String g_school=Pbean.getG_school();
String g_time=Pbean.getG_time();
String mobile=Pbean.getMobile();
String p_note=Pbean.getP_note();
String phone=Pbean.getPhone();
String post=Pbean.getPost();
String qq=Pbean.getQq();
String sect=Pbean.getSect();
String sex=Pbean.getSex();
String x_ray=Pbean.getX_ray(); String sqlstr = "select * from [person] where t_name in (select name from [user] where name="+"'"+name+"')";
ResultSet rs=stmt.executeQuery(sqlstr);
if(rs.next()) { t_id = rs.getString("t_id");
t_name = rs.getString("t_name");
sex=rs.getString("sex");
d_identity = rs.getString("d_identity");
post=rs.getString("post");
degree=rs.getString("degree");
x_ray=rs.getString("x_ray");
g_school=rs.getString("g_school");
g_time=rs.getString("g_time");
f_language=rs.getString("f_language");
mobile=rs.getString("mobile");
phone=rs.getString("phone");
qq=rs.getString("qq");
e_mail=rs.getString("e_mail");
p_note=rs.getString("p_note");
b_date=rs.getString("b_date");
sect=rs.getString("sect");
}%> <table width="650" height="500" border="1" align="center" bgcolor="#FFFFFF">
<tr>
<td width="150" valign="top">
<table width="150" height="500" border="1">
<tr>
<th width="150" height="25">ID:</th>
</tr>
<tr>
<th height="25">姓名:</th>
</tr>
<tr>
<th width="150" height="25">性别:</th>
</tr>
<tr>
<th height="25">出生年月:</th>
</tr>
<tr>
<th height="25">身份证号:</th>
</tr>
<tr>
<th height="25">部门:</th>
</tr>
<tr>
<th height="25">职称:</th>
</tr>
<tr>
<th height="25">学位:</th>
</tr>
<tr>
<th height="25">学历:</th>
</tr>
<tr>
<th height="25">毕业学校:</th>
</tr>
<tr>
<th height="25">毕业时间:</th>
</tr>
<tr>
<th height="25">外语级别:</th>
</tr>
<tr>
<th height="25">手机号码:</th>
</tr>
<tr>
<th height="25">小灵通号:</th>
</tr>
<tr>
<th height="25">QQ号:</th>
</tr>
<tr>
<th height="25">邮箱:</th>
</tr>
<tr>
<th height="100">备注:</th>
</tr>
</table></td>
<td width="500" valign="top"> <table width="500" height="500" border="1">
<tr>
<td height="25">
<%out.print(t_id);%>
</td>
</tr>
<tr>
<td height="25">
<%=t_name%>
</td>
</tr>
<tr>
<td height="25">
<%=sex%>
</td>
</tr>
<tr>
<td height="25">
<%=b_date%>
</td>
</tr>
<tr>
<td height="25">
<%=d_identity%>
</td>
</tr>
<tr>
<td height="25">
<%=sect%>
</td>
</tr>
<tr>
<td height="25">
<%=post%>
</td>
</tr>
<tr>
<td height="25">
<%=degree%>
</td>
</tr>
<tr>
<td height="25">
<%=x_ray%>
</td>
</tr>
<tr>
<td height="25">
<%=g_school%>
</td>
</tr>
<tr>
<td height="25">
<%=g_time%>
</td>
</tr>
<tr>
<td height="25">
<%=f_language%>
</td>
</tr>
<tr>
<td height="25">
<%=mobile%>
</td>
</tr>
<tr>
<td height="25">
<%=phone%>
</td>
</tr>
<tr>
<td height="25">
<%=qq%>
</td>
</tr>
<tr>
<td height="25">
<%=e_mail%>
</td>
</tr>
<tr>
<td height="100" valign="top">
<%=p_note%>
</td>
</tr>
</table></td>
</tr>
<tr align="center">
<td height="25" colspan="2"><a href="main.jsp">返回</a></td>
</tr>
</table>
</body>
</html>
引入的bean就是连个ActionForm,我的想法是你再页面输入的值不是保存在form离了吗,为什么name不能获得到值了,是不是要session什么的,我菜鸟,初学者,尽量说具体点,谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货