Programming Tutorials

A JSP page that gets properties from a bean

By: Hisham Alssadi in JSP Tutorials on 2010-11-28  

<jsp:useBean
id=\"bean1\" class=\"com.awl.bean1\"/>
<HTML>
<HEAD><TITLE>Beans!</TITLE></
HEAD>
<BODY BGCOLOR=\"#FFFFFF\">
<p> here is some data that came from bean1:</p>
<UL>
<LI> the name of the bean is :
<jsp:getProperty name=\"bean1\" property=\"name\"/>
<LI> the 7th prime number is:
<jsp:getProperty name=\"bean1\" property=\"sevenPrimeNumber\"/
>
<LI>the current time is :
<jsp:getProperty name=\"bean1\" property=\"currentTime\"/>
</UL>
<CENTER>
<TABLE BORDER =\"0\">
<TR>
<TD BGCOLOR=\"<jsp:getProperty name=\"bean1\"
property=\"color\"/>\">
<P> the information from a bean can be used anywhere on the
page!</P>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>





Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in JSP )

Latest Articles (in JSP)