You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Linus Nikander <li...@nikander.net> on 2003/07/02 11:32:50 UTC

bean:write problem

I saw this problem was already posted earlier, but no solution was found.
I've got the same problem but I might be able to supply you with a bit more
information. This is my first ever attempt at using Struts so I can't say if
this problem occurs in 1.0.x since I started with 1.1 right off the bat.

I have a simple jsp which is supposed to display the data stored in a bean
in a table:

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

<jsp:useBean id="objLimits" class="com.therastone.utils.LimitSummaryHandler"
scope="request"/>
<body>
<h2>Limitlist</h2>
<table border=1 bgcolor="#FFFFCC">
  <tr>
    <th>Title</th>
    <th>Length (min.)</th>
    <th>Actors</th>
  </tr>
<logic:iterate id="LimitSummaryEntry" name="objLimits"
property="summaryList">
  <tr>
    <td><bean:write name="LimitSummaryEntry" property="limitType" /></td>
    <td><bean:write name="LimitSummaryEntry" property="numberOfEntries"
/></td>
  </tr>
</logic:iterate>
</table>
</body>


LimitSummaryHandler has a getSummaryList() method which returns a linked
list where the LimitSummaryEntries are stored.

The "  <bean:write name="LimitSummaryEntry" property="limitType" />" works
fine but
"<bean:write name="LimitSummaryEntry" property="numberOfEntries" />" throws
the following:

Root cause of ServletException
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
 at
org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.ja
va:1103)
 at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
 at org.apache.struts.util.RequestUtils.message(RequestUtils.java:1018)
 at
org.apache.struts.taglib.bean.WriteTag.retrieveFormatString(WriteTag.java:31
3)
 at org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:359)
 at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:292)
 at jsp_servlet.__listlimitsummary._jspService(__listlimitsummary.java:184)
 at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
 at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
 at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2546)
 at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2260)
 at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


The definitions of the two getters are
public int getNumberOfEntries()
public String getLimitType() {


As with the previous poster, if i change the returntype of
getNumberOfEntries() to String it works fine. With int or double i get the
above error. Any clues ?

//Linus Nikander - linus@nikander.net







---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org