BBJSP CORE:Map Tag (Deprecated)

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

Description

In BBj 16.0 and higher, the map tag can be used in a BBJSP BBJSP Page to access data held within a HashMap.

Attributes

Attribute Name

Description

Required

Expression

Data Type

data

should evaluate to a HashMap that contains the data.

true

true

HashMap

keys

specifies in the name of the attribute to set in the BBjspPageContext that will contain a BBjVector of the key values.

false

true

String

values

specifies in the name of the attribute to set in the BBjspPageContext that will contain a BBjVector of the values.

false

true

String

Remarks

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

Example

<!DOCTYPE html/>

<%-- WE MUST IMPORT THE TAG LIBRARY BEFORE WE CAN USE IT --%>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>

<%
map! = BBjAPI().makeBBJSP().makeBBjspHashMap()
map!.put("Name","Fred Bloggs")
map!.put("Address","No 5, Bedrock")
map!.put("Job Title","Site foreman")
%>
<html>
<head> 
<title><c:log></title> 
<c:set var='m' value='<%= map! %>' />
<c:map data='${m}' keys='keys' />
<c:iterate data='${keys}' id='k'>
${k} - ${m[k]} <br>
</c:iterate>
</head>
<body>
</body>
</html>

See Also

BBJSP

Core Tag Library

BBjspHashMap