JSP – useBean action,setProperty action,getProperty action

JSP useBean action

The JSP useBean used to instantiates a java bean with a specific name and scope.

<jsp:useBean id="person" scope="session" class="com.java.connect.Person" />

JSP setProperty action

The JSP action setProperty action use to sets a property value or values in a bean.

<jsp:setProperty name=" person " property="username" value="Mahendra" />

JSP getProperty action

The JSP getProperty action use to get the value of a bean property so that you can display it in a result page.

<jsp:useBean id="person" scope="session" class="com.java.connect.Person" />
The username is <jsp:getProperty name="person" property="username" />

Leave a Reply

Your email address will not be published. Required fields are marked *