what is the scope you are using to look up for the bean, try putting one and you may fix it..
Shri -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 27 November 2001 1:26 PM To: [EMAIL PROTECTED] Subject: Problem with Iterating-No getter method for property....... Any Ideas? Hello Ladies and Gentlemen I am just starting out with Struts and I have a problem when I try and iterating over a Hasmap. I am always getting the error [snip] javax.servlet.ServletException: No getter method for property messages of bean Messages [snip] The jsp code which I am calling looks like this --------------------------jsp code start-------------------------------- [snip] <logic:iterate id="messagestag" name="Messages" property="messages"> <tr> <td align="left"> <bean:write name="messagestag" property="messageSubject" filter="true"/> </td> <td align="center"> <bean:write name="messagestag" property="messageBody" filter="true"/> </td> <br> </logic:iterate> [snip] --------------------------jsp code stop-------------------------------- The messages bean is an instance of a Messages object ----------------------------Messages.java start---------------------- public final class Messages implements Serializable { private Hashtable messages = new Hashtable() ; public void Messages() { Message tmpMessage = new Message(); tmpMessage.setMessageBody("Test body 1"); tmpMessage.setMessageSubject("Test Subject 1"); messages.put("message1", tmpMessage); tmpMessage.setMessageBody("Test body 2"); tmpMessage.setMessageSubject("Test Subject 2"); messages.put("message2", tmpMessage); } public Message[] getMessages() { synchronized (messages) { Message results[] = new Message[messages.size()]; Enumeration subs = messages.elements(); int n = 0; while (subs.hasMoreElements()) { results[n++] = (Message) subs.nextElement(); } return (results); } } } ----------------------------Messages.java stop---------------------- ----------------------------Message.java start---------------------- public final class Message implements Serializable { private String messageBody = null; private String messageSubject = null; public String getMessageBody() { return (this.messageBody); } public String getMessageSubject() { return (this.messageSubject); } public void setMessageBody(String messageBody) { this.messageBody = messageBody; } public void setMessageSubject(String messageSubject) { this.messageSubject = messageSubject; } } ----------------------------Message.java stop---------------------- Can someone please tell me what I am doing wrong and how I can fix it so I do not get this error. Cheers Tony -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

