Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What is the use of <bean:define/> tag defined by Bean tag library in Struts framework? Name all of its attribute?
The <bean:define/> tag is used to retrieve the value of a named bean property and define it as a scripting variable, which is will be stored in the scope specified by the toScope attribute. The retrieved object will perform type conversion on the returned property value, unless it is a Java primitive type, in which case it is wrapped in the appropriate wrapper class.
This <bean:define/> tag has a body type of JSP and supports seven attributes:
id, name, property, scope, toScope, type, value.

  <jsp:useBean
    id="user"
    scope="page"
    class="com.User" />
  <bean:define 
    id="user"
    name="user"
    property="firstName" />

  Welcome: <%= name%>