1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A JSP page that gets properties from a bean

Discussion in 'JSP' started by alssadi, Jul 3, 2011.

  1. alssadi

    alssadi Banned

    Joined:
    Dec 11, 2010
    Messages:
    41
    Likes Received:
    3
    Trophy Points:
    0
    Occupation:
    Creative director & web developer
    Location:
    Dubai
    Home Page:
    the code below explains everything by using the getProperty :-

    HTML:
     <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>
     
     

Share This Page