Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JSP (http://www.go4expert.com/forums/jsp/)
-   -   A JSP page that gets properties from a bean (http://www.go4expert.com/forums/jsp-page-properties-bean-t26202/)

alssadi 3Jul2011 19:07

A JSP page that gets properties from a bean
 
the code below explains everything by using the getProperty :-

HTML Code:

<jsp:useBean id=\"bean1\" class=\"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>



All times are GMT +5.5. The time now is 21:57.