This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes JspException: No getter method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JspException: No getter method" Watch "JspException: No getter method" New topic
Author

JspException: No getter method

Sam Shen
Greenhorn

Joined: Feb 15, 2002
Posts: 8
Hi,
I've a problem in using struts bean tag.
When I ran the following jsp file:
jsp file:..........
<logic:iterate id="element" name="items">
<li><bean:write name="element" property="name" /> <<---- this line causes problem
</logic:iterate>
result:...........
javax.servlet.jsp.JspException: No getter method for property name of bean element
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290)

"items" is a hashtable in session.
When I use the following code:
<%
Hashtable hitems= (Hashtable)session.getAttribute("items");
for (Enumeration e = hitems.elements(); e.hasMoreElements(); ){
WatchItem witem = (WatchItem)e.nextElement();
%>
<%=witem.getName() %>
<%
}
%>
I can get each property from items's element.
Can you give me some help?
Many Thanks,
Sam
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Moving to the Struts forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JspException: No getter method
 
Similar Threads
No getter method for property name of bean userList
Help with Indexing problem using logic:iterate and nested:iterate
Accessing indexed property with JSTL
in logic iterate tag, nested property throws no getter method error
Struts: Submit form with Map property