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:
    http://uaeinfographics.blogspot.com/
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice