Java Servlets
<%@ page import="HelloBean" %> <jsp:useBean id="hello" class="HelloBean"> <jsp:setProperty name="hello" property="name" param="name"/> </jsp:useBean> <HTML> <HEAD><TITLE>Hello</TITLE></HEAD> <BODY> <H1> Hello, <jsp:getProperty name="hello" property="name" /> </H1> </BODY> </HTML>with the bean defined as
public class HelloBean { private String name = "World"; public void setName(String name) { this.name = name; } public String getName() { return name; } }
id
in the useBean
but by name
in the get/setProperty
. <.. property="propertyname"
param="paramName">
to set propertyname to some
param's value<.. property="propertyname"
value="constant">
to set it to a constant.76 of 89