<%@ page language="java" import="kg.TestBean2;" %> <%@ page contentType="text/html;charset=gb2312" %> <html> <head> <title>HelloBean</title> </head> <body> <%-- <% kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean"); if(testbean==null){ testbean = new kg.TestBean2(); session.setAttribute("testbean",testbean); } %> --%> <jsp:useBean id="testbean" class="kg.TestBean2" scope="page" /> <%-- <jsp:setProperty name="testbean" property="myText" /> <jsp:getProperty name="testbean" property="myText"/> <jsp:setProperty name="testbean" property="myPassword"/> <jsp:getProperty name="testbean" property="myPassword"/> --%> <jsp:setProperty name="testbean" property="*"/> 用户名:<%=new String(testbean.getMyText().getBytes("ISO8859_1"),"GBK")%> 密码:<%=testbean.getMyPassword()%> </body> </html>