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.8: IBM extensions to JSP .91 syntax >
4.2.2.3.8.1: JSP .91 syntax: Tags for variable data >
4.2.2.3.8.1.1b: Example: JSP .91 syntax: INSERT tag syntax

4.2.2.3.8.1.1b: Example: JSP .91 syntax: INSERT tag syntax

Regular syntax

<insert bean=userProfile property=username></insert>
<insert requestparm=company default="IBM Corporation"></insert>
<insert requestattr=ceo default="Company CEO"></insert>
<insert bean=userProfile property=lastconnectiondate.month></insert>

In most cases, the value of the property attribute will be just the property name. However, you access a property of a property (sub-property) by specifying the full form of the property attribute. The full form also gives you the option to specify an index for indexed properties. The optional index can be a constant (such as 2) or an index like the one described in <REPEAT> tag. Some examples of using the full form of the property attribute:

<insert bean=staffQuery property=address(currentAddressIndex)></insert>
<insert bean=shoppingCart property=items(4).price></insert>
<insert bean=fooBean property=foo(2).bat(3).boo.far></insert>

Alternate syntax

<insert>
<img src=$(bean=productAds property=sale default=default.gif)>
</insert>

<insert>
<a href="http://www.myserver.com/map/showmap.cgi?country=$(requestparm=country
default=usa)&city$(requestparm=city default="Research Triangle Park")
&email=$(bean=userInfo property=email)>Show map of city</a>
</insert>

Go to previous article: JSP .91 <INSERT> tag syntax Go to next article: JSP .91 syntax: Alternate syntax for the <INSERT> tag

 

 
Go to previous article: JSP .91 <INSERT> tag syntax Go to next article: JSP .91 syntax: Alternate syntax for the <INSERT> tag