Packagecome.hanqi.test; Public classYhbean {PrivateString username; PrivateString password; PrivateString Email; PrivateString Dizhi; PublicString GetUserName () {returnusername; } Public voidSetusername (String username) { This. Username =username; } PublicString GetPassword () {returnpassword; } Public voidSetPassword (String password) { This. Password =password; } PublicString Getemail () {returnemail; } Public voidsetemail (String email) { This. email =email; } PublicString Getdizhi () {returnDizhi; } Public voidSetdizhi (String Dizhi) { This. Dizhi =Dizhi; } }
<%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Registered</title></Head><Body><formAction= "testyhbean2.jsp"Method= "POST"><TableAlign= "Center"width= "The "Height= "$"Border= "1"cellspacing= "0"cellpadding= "0"><TR><TDAlign= "Center"Height= " the"colspan= "2">Please enter the registration information</TD></TR><TR><TD>Account:</TD><TD><inputtype= "text"name= "username"></TD></TR><TR><TD>Password:</TD><TD><inputtype= "Password"name= "Password"></TD></TR><TR><TD>Mailbox:</TD><TD><inputtype= "text"name= "Email"></TD></TR><TR><TD>Address:</TD><TD><inputtype= "text"name= "Dizhi"></TD></TR><TR><TDAlign= "Center"colspan= "2"><inputtype= "Submit"value= "Submit"></TD></TR></Table></form></Body></HTML>
<%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Register display</title></Head><Body><%request.setcharacterencoding ("UTF-8");%><Jsp:usebeanID= "Person"class= "Come.hanqi.test.YhBean"><Jsp:setpropertyname= "Person" Property="*"/></Jsp:usebean>your registration information is:<BR>Account Number:<Jsp:getproperty Property= "username"name= "Person"/><BR>Password:<Jsp:getproperty Property= "Password"name= "Person"/><BR>Email:<Jsp:getproperty Property= "Email"name= "Person"/><BR>Address:<Jsp:getproperty Property= "Dizhi"name= "Person"/><BR></Body></HTML>
Write a JavaBean object that encapsulates user information, and output the user's registration information by manipulating the JavaBean action ID.