BBJSP CORE:VGet Tag (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, the vget (vector-get) tag can be used in a BBJSP Page to access a specified element within a BBjVector.

Attributes

Attribute Name

Description

Required

Expression

Data Type

data

the data attribute specifies the BBjVector that contains the data

true

true

BBjVector

id

the id attribute specifies the id to use for the current element during the looping process

true

true

String

index

the index attribute specified the item number to get from the vector. A value of zero (0) refers to the first element in the vector.

true

true

int

Remarks

The Core Tag Library library needs to be referenced in the BBJSP Page

In the following example we store a vector containing several strings in the page context and using the <c:vget> tag we read element 3 from the vector but since the BBjVector is a zero-based list, item 3 is the 4th element in the array and contains the text "FOUR".

Example

<!DOCTYPE html/>

<%-- Import the tag library --%>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>

<%-- let's make a BBjVector --%>
<%
theVect! = new BBjVector() 
theVect!.add("ONE")
theVect!.add("TWO")
theVect!.add("THREE")
theVect!.add("FOUR")
theVect!.add("FIVE")

REM == Save the vector in the page context
#PageContext!.setAttribute("theVector",theVect!)
%>

<html>
<head> 
<title><c:vget></title> 
</head>
<body>
<c:vget data="${theVector}" id="item" index='3'>
Item #3 in the vector is : ${item}
</c:vget> 
</body>
</html>

See Also

BBJSP

Core Tag Library