类型转换(急)!!!!!!!!!!!!!!
2 个页面间传值老出错,请帮忙!
1。地一个页面的代码:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>无标题文档</title>
</head>
<body>
<%
request.setAttribute("Name",12);
request.setAttribute("Password",45);
%>
<jsp:forward page="page2.jsp"/>
</body>
</html>
2。第 个页面的代码:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.lang.Object" errorPage="" %>
<html>
<head>
<title>无标题文档</title>
</head>
<body>
<%
//Object sname = new String("");
//sname = request.getAttribute("Name");String snames = new String(sname);
//String spsd = request.getAttribute("Password");
//int Name=Integer.parseInt(snames);
//int Password=Integer.parseInt(spsd);
//out.println(sname+".......=Name");
//out.println(Name+".......=Name");
// out.println(Password+"......=Password");
String Name=(String)request.getAttribute("Name");
String pasw=(String)request.getAttribute("Password");
out.println("Name");
out.println("pasw");
%>
</body>
</html>
跪求了!!!