On 9/11/2002 at 2:53 PM David Graham wrote:

>I'm having some trouble getting this to work.  I get the error message 
>"javax.servlet.jsp.JspException: No getter method for property 
>categoryName(2) of bean org.apache.struts.taglib.html.BEAN"
>
>I have a HashMap in my form called categoryNames and a getter/setter like 
>this:
>public void setCategoryName(String key, Object name) {
>     this.categoryNames.put(key, name);
>}
>
>public Object getCategoryName(String key) {
>     return this.categoryNames.get(key);
>}

Looks correct to me.

>I put a bunch of AccountCategory objects in the session and then the jsp 
>loops through to display the input boxes like this:
>
><c:forEach var="category" items="${sessionScope.accountCategories}">
>    <html:text
>      property="categoryCode(<%= 
>((AccountCategory)pageContext.getAttribute("category")).getAccountCategoryI
D() 
>%>)"/>
>
></c:forEach>
>
>Any ideas?  Do I need struts 1.1 for this (I'm using 1.0.2)?

You do need struts 1.1 for this, sorry, I should have made that explicit.
Also, fwiw, I've had trouble with this usage:

>      property="categoryCode(<%= 
>((AccountCategory)pageContext.getAttribute("category")).getAccountCategoryI
D() 
>%>)"/>

jasper doesn't seem to evaluate the <%= %> expression inside the prompt
attribute value. Danged if I know why, but obviously my understanding of
the jsp processing model isn't the best. I use a scriptlet instead:

<% String property = "categoryCode(" + foo + ")"; %>
<html:text property="<%=property%>"/>

I would hope someone has a better solution to suggest. :)

- donald


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to