Entity Bean defined in JSP
<jsp:usebean id= "clu" class= "Cn.domain.CacluBean" ></jsp:useBean>
<jsp:getproperty property= "propertyname" name = "CLU" > Gets the Bean's property value and outputs the value to the page;
El expression : ${entity object name}
When an El expression takes data, a. Number is usually used, and.
Pagecontext.findattribute ("Data");//page,request,session,application Lookup Order
<!--to find a bean in the page, if not, create a bean-->
<!--the contents of the label body are only used when creating the bean (instantiated).-->
The JSP assigns a value to the bean :
<!--hand-assigned value-->
<jsp:setproperty property= "Age" Name= "Personbean" value= "/>"
<!--request parameter assignment, request data support converts the string to 8 basic data types-->
<jsp:setproperty property= "Age" Name= "Personbean" param= "Age"/>
<jsp:setproperty property= "Birthdty" name= "Personbean" value= "<%=new" Date ()%> "/>"
<jsp:setproperty property= "*" Name= "clu" > Set the Bean's properties, with all the request parameters assigned to the bean;
To import Java Classes :
<%@ page import= "cn.domain.*"%>
<!--static include: Compile-time contains, compile all the JSP contained in a servlet, efficiency performance than dynamic include good-->