struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bauer, John" <JBa...@Juniper.com>
Subject taglib bean property problem?
Date Wed, 27 Jun 2001 15:01:52 GMT

I have a class which has a Vector property I wish to iterate over.  It
appears the logic:iterate tag is not finding the property for the Vector,
even though it is clearly present and validated through other means.  The
iterate tag works fine when I use the 'collection' attribute to explicitly
set the collection.  The 'property' attribute does not function and I get
the error below.  Is there anything I am doing wrong here, or is this a bug?

Wed Jun 27 10:39:35 EDT 2001:<E> <ServletContext-General> Root cause of
ServletException
javax.servlet.jsp.JspException: No getter method for property
statementListBlock of bean list
        at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java,
Compiled Code)
        at
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java,
Compiled Code)

        at jsp_servlet._strutstester._jspService(_strutstester.java,
Compiled Code)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:120)
        at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:9
15)
        at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:8
79)
        at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.
java:269)
        at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
        at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)


 Here is a sample web page and output showing the issue:

web page:

<%@ page import="com.juniper.bus.statement.xmlapi.*" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%
  {
        StatementList list1 = new StatementList();

        StatementListBlock block = new StatementListBlock();
        list1.addStatementListBlock(block);

        block.setAccountNumber("1234123412341234");

        Status status = new Status();
        status.setType("success");
        status.setCode("code");
        status.setMessage("message");
        block.setStatus(status);

        block.setType("DDA");

        StatementListItem item = new StatementListItem();
        block.addStatementListItem(item);
        item.setStartDate("20010501");
        item.setStatementDate("20010601");

        pageContext.setAttribute("list", list1, PageContext.PAGE_SCOPE);
	
  }
%>

<jsp:useBean id="list" scope="page"
class="com.juniper.bus.statement.xmlapi.StatementList"/>

<html>
<head>
	<title>Struts Tester</title>
</head>

<body>
Test page


<p></p>
Class Name:  <%= list.getClass() %>

<p></p>
Block Count (script): <%= list.getStatementListBlockCount() %>

<p></p>
Statement list block count (bean tag):  <bean:write name="list"
property="statementListBlockCount"/>

<p></p>
block (script w/toString):  <%= list.getStatementListBlock().toString() %>>

<p></p>
block (script without toString):  <%= list.getStatementListBlock() %>

<p></p>
block (class):  <%= list.getStatementListBlock().getClass() %>


<p></p>
<logic:iterate id="block" collection="<%= list.getStatementListBlock() %>"
type="com.juniper.bus.statement.xmlapi.StatementListBlock">
  <p></p>
  <bean:write name="block" property="accountNumber"/>
  <logic:iterate id="item" collection="<%= block.getStatementListItem() %>">
     <p></p>
     <bean:write name="item" property="startDate"/>
  </logic:iterate>
</logic:iterate>

<p></p>
<logic:iterate id="block" name="list" property="statementListBlock"
type="com.juniper.bus.statement.xmlapi.StatementListBlock">
  <p></p>
  <bean:write name="block" property="accountNumber"/>
</logic:iterate>

</body>
</html>

output:

Test page 
Class Name: class com.juniper.bus.statement.xmlapi.StatementList 
Block Count (script): 1 
Statement list block count (bean tag): 1 
block (script w/toString):
[com.juniper.bus.statement.xmlapi.StatementListBlock@52caa8ea]> 
block (script without toString):
[com.juniper.bus.statement.xmlapi.StatementListBlock@52caa8ea] 
block (class): class java.util.Vector 
1234123412341234 
20010501 
Error 500--Internal Server Error	



John Bauer
Technology Director
Juniper Bank
PH: (302) 255-8240
jbauer@juniper.com




_______________________________________________________ 

Juniper Bank 
"Rated #1 in Customer Confidence" 
Gomez Inc., Winter 2000 Internet Credit Card Scorecard 
www.Juniper.com 
_______________________________________________________ 

This e-mail and any files transmitted with it may contain confidential
and/or proprietary information. It is intended solely for the use of the
individual or entity who is the intended recipient. Unauthorized use of this
information is prohibited. If you have received this in error, please
contact the sender by replying to this message and delete this material from
any system it may be on.

Mime
View raw message