JavaBean use and scope

Here Insert Picture Description
Use Rule:
Here Insert Picture DescriptionHere Insert Picture Description
For example:Here Insert Picture Description
transfer of value and a method for obtaining the value of
<% @ Page Language = "Java" contentType = "text / HTML;
charset = UTF-. 8"
the pageEncoding = "UTF-. 8"%>
<%
Request.setCharacterEncoding ( " UTF-8 ");

response.setContentType("text/html;charset=UTF-8");

%>

jsp:useBean标签使用范例3 // use useBean scope statement for the page
<form action="" method="post">
<p>
		输入所有参数:<br> 姓名:<input type=text name="name" value="张洪"><br>       //value为默认值
		性别:<input type=text name="sex" value="女"><br> 年龄:<input
			type=text name="age" value="25"><br> <input type=submit
			value="提交">
</form>
<jsp:setProperty property="*" name="person" />
<h2>
	姓名:<jsp:getProperty property="name" name="person" /></h2>
<h2>
	性别:<jsp:getProperty property="sex" name="person" /></h2>
<h2>
	年龄:<jsp:getProperty property="age" name="person" /></h2>
Operating results as follows:! [Inserted here described image] (https://img-blog.csdnimg.cn/20190610160006309.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzIzMjQyMw==,size_16,color_FFFFFF , t_70)

Guess you like

Origin blog.csdn.net/weixin_43232423/article/details/91381342