Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble getting displaytag to work

Status
Not open for further replies.

Ssanai80

IS-IT--Management
Jun 28, 2001
21
0
0
US
Hello folks,

A newbie needs some help with using displaytag (
I followed the examples they had at the displaytag sight, but when I run the jps page, only the object representation is shown and not the actual string value of the object. According to the samples at displaytag.org, <display:table should process through the list and apply toString() to each object. Maybe I missed something or do not have the right setup (Tomcat 4.1, JDK 1.4.1, Eclipse 2.1.1).

Here is what display:table with export function turned on outputs on the jsp page:

Bytes
[B@178dc08
[B@1b5c22f
[B@1dfd90f
[B@1238785
[B@e2433b
[B@abe654

Export options: Excel | XML | CSV


Here is my .jsp page that creates and populates a list, then pass it to <display:table

<%@ page language="java"%>
<%@ page import="java.util.*,com.miso.docs.FileNav;" %>
<%@ taglib uri=" prefix="bean" %>
<%@ taglib uri=" prefix="html" %>
<%@ taglib uri=" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri=" prefix="template" %>
<%@ taglib uri=" prefix="nested" %>
<%@ taglib uri=" prefix="display" %>

<%

%>

<%
List test2 = new ArrayList( 6 );
test2.add( "Test String 1" );
test2.add( "Test String 2" );
test2.add( "Test String 3" );
test2.add( "Test String 4" );
test2.add( "Test String 5" );
test2.add( "Test String 6" );
request.setAttribute( "test2", test2 );

%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html:html locale="true">
<head>
<html:base />
<title>test</title>
<style type="text/css">
@import url("../style/maven-base.css");
</style>
<style type="text/css">
@import url("../style/maven-theme.css");
</style>
<style type="text/css">
@import url("../style/project.css");
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta>
<meta name="author" content="MISO IT"></meta>
<meta name="email" content="*ITSett"></meta>
</head>

<body class="composite">
<table height="100%" width="100%" border="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="left">
<html:img src="../images/MISO_logo_top.gif" border="0"/>
</td>
</tr>
</table>
</td>
</tr>

<tr height="100%">
<td valign="top">
<div id="breadcrumbs">
<table border="0" width="100%" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2">IT Settlements Framework</td>
</tr>
</table>
</div>

<table border="0" width="100%" height="100%" cellpadding="8" cellspacing="0" id="layout">
<tr valign="top">
<jsp:include page="/pages/navigationLinks.jsp" />
<td>
<div id="bodyColumn">
<div class="contentBox">
<div class="section">
<div class="sectionTitle"><a name="Queries">Welcome</a></div>
<p>

Hurray!<br><Br>
<%=(String)request.getAttribute("data")%><br>

<% out.println("FileNav.getFileNames: "+FileNav.printList()); %>
<display:table name="test2" export="true" class="sectionTitle"/>


</p>
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" style="width:100%" cellpadding="4" cellspacing="0" class="footer">
<tr>
<td align="center">
©2004 Midwest ISO. All Rights Reserved.
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html:html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top