Struts Bean Tag Library

To use the tags in Bean Tag Library, you need to do the following:
  • Copy the struts-bean.tld file into WEB-INF folder.
  • Use the following <taglib> in any jsp where you want to use tags of Bean Tag Library.
     <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
There are following tags in Bean Tag Library:
  1. <bean: parameter>
  2. <bean: cookie>
  3. <bean: header>
  4. <bean: size>
  5. <bean: page>
  6. <bean: define>
  7. <bean: include>
  8. <bean: write>
  9. <bean: message>
<bean: parameter>

Parameter tag gets the values of specified request parameter and stores that in the jsp scripting variables.
Attributes are: id, name, value, multiple.
Usage:
  • <bean: parameter  id="email" name ="emailid" />
  • <bean: parameter  id="email" name ="emailid" value="arbind.sharma2@gmail.com />
  • <bean: parameter  id="email" name ="emailid" multiple="true" />
<bean: cookie>
Cookie tag gets the values of specified request cookie and stores that in the jsp scripting variables.
Attributes are: id, name, value, multiple.
Usage:
  • <bean:  cookie   id="email" name ="emailid" />
  • <bean:  cookie   id="email" name ="emailid" value="arbind.sharma2@gmail.com />
  • <bean:  cookie   id="email" name ="emailid" multiple="true" />
<bean: header>
    Header tag gets the values of specified request  and stores that in the jsp scripting variables.
    Attributes are: id, name, value, multiple.
    Usage:
    • <bean:  header  id="ho" name ="host" />
    • <bean:   header    id="referid" name ="refername" value="arbind.sharma2@gmail.com />
    • <bean:   header    id="al" name ="accept-language" multiple="true" />
    <bean: size>
    Size tag gets the size of specified collection or map or array and store that in the jsp scripting variable.
    Attributes are: id, name, property, scope, collection

    0 comments :

    Post a Comment