donaricano-btn

(2)Action Tags_useBean


1) jsp:useBean action tag

- The jsp:useBean action tag is used to locate or instantiate a bean class

- If bean object of the Bean class is already created, it doesn't create the bean depending on the scope

- If object of bean is not created, it instantiates the bean


Example

1_1. index.jsp

1_2. java


2) jsp: setProperty and jsp: getProperty

- The setProperty and getProperty action tags are used for developing web application with Java Bean

- It is a reusable software component that represents data


2_1. setProperty

- It you have to set all the values of incoming request in the bean

<jsp: setProperty name="bean" property="*"/>

If you have to set value of the incoming specific property

<jsp: setProperty name="bean" property="username"/>

- If you have to set a specific value in the property

<jsp: setProperty name="bean" property="username" value="Kunar"/>


2_2. getProperty

- The jsp: getProperty action tag returns the value of the property

<jsp: getProperty name="obj" property="name"/>


2_3. Example

- index.html

- process.jsp

- The part of the red is set for property

- The part of a green can get values

- Java




'Back-End > Jsp' 카테고리의 다른 글

[Jsp] MVC  (0) 2016.07.12
[Jsp] Expression Language(EL) - JSP  (0) 2016.07.08
[Jsp] (1)Action Tags_forward&include  (0) 2016.07.07
[Jsp] Exception  (0) 2016.07.07
[Jsp] Include & taglib directive  (0) 2016.07.07
블로그 이미지

리딩리드

,