Sat Jan 17, 2009 1:02 am
<HTML>
<HEAD>
<TITLE>use of Java Beans in jsp</TITLE>
</HEAD>
<BODY>
<H1>Using Beans and Session Scope</H1>
<jsp:useBean id="myhome" class="codebeans.Home" scope="session" />
<%
myhome.setHomeName("Codemiles Home");
%>
Our home name is : <jsp:getProperty name="myhome" property="HomeName" />
</BODY>
</HTML>
package codebeans;
public class Home {
String HomeName ;
public int getHomeName() {
return this.HomeName;
}
public void setHomeName(String HomeName)
{
this.HomeName = HomeName;
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.