InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.3: Overview of JSP file content >
4.2.2.3.5: JSP syntax: useBean tag >
4.2.2.3.5.3a: JSP .91 syntax: Setting bean properties

4.2.2.3.5.3a: JSP .91 syntax: Setting bean properties

You can set the bean properties by using the <PARAM> tag within the <BEAN> tag. The <PARAM> tag specifies a list of properties and the corresponding values. The properties are automatically set in the bean using introspection. The properties are set once when the bean is instantiated. The <PARAM> tag syntax is:

<PARAM name="property_name" value="property_value">

This syntax is an IBM extension to the JSP 0.91 <PARAM> tag. The IBM syntax is consistent with the syntax of the <PARAM> tag used within the <SERVLET> and <APPLET> tags.

In addition to using the <param> tag to set bean properties, there are three other methods:

  • Specifying query parameters when requesting the URL of the JSP file that contains the bean. The introspect attribute must be set to yes. An example:
    http://www.myserver.com/signon.jsp?name=jones&password=d13x
    
    where the bean property name will be set to jones.
  • Specifying the properties as parameters submitted through an HTML <FORM> tag. The JSP method directive must be set to post. The action attribute is set to the URL of the JSP file that invokes the bean. The introspect attribute must be set to yes. An example:
    <form action="http://www.myserver.com/SearchSite.jsp" method="post">
    <input type="text" name="Search for: ">
    <input type="submit">
    </form>
    
  • Using JSP syntax to set the bean property

Go to previous article: JSP syntax: Setting useBean properties Go to next article: JSP .91 syntax: BEAN tags

 

 
Go to previous article: JSP syntax: Setting useBean properties Go to next article: JSP .91 syntax: BEAN tags