Hi again Matt, On 21 Oct 2007 at 11:43, Matt Raible wrote:
> Does your Product class have a getId() method? I had another look at another POJO in the same project, "Company". It also inherites from BaseEntity which provides its Id field. the CompanyList.jsp works fine. Now Company uses the Generic Dao and Manager so I'm guessing my problem lies somewhere in one of my beans. In my ProductAction, the getProducts() method is definitely not being called - I've put debugging lines at the start of the ProductAction.getProducts() method and at the start of the CompanyAction.getCompanies() method. The debugging for getCompanies() appears in the log, but not for getProducts(). Interestingly, I added a no-parameter constructor to ProductAction and put debugging in that and it also hasn't appeared. One thing I don't understand is why my CompanyList.jsp works fine without any "<c:set var="companies" ...> tag. I'm guessing that the the "name" attribute in the display:table tag (which is "companies" in this case) is somehow magically matched up with the CompanyAction.getCompanies method. > On 10/21/07, Rob Hills <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > I have a weird error on a Listing JSP that's had me stumped for several > > hours. > > > > I have a POJO named "Product" and have built associated ProductDao, > > ProductDaoHibernate, ProductManager, ProductManagerImpl > > and ProductAction classes, as well as tests for Dao, Manager and Action. > > I have a ProductList.jsp and I believe I've correctly configured all the > > "glue" bits (bean defninitions in applicationContext.xml, action > > definitions in struts.xml etc.). > > > > All tests pass OK and the web app starts up (Jetty + HSQLDB). > > > > However, when I go to view my products list, I get a blank page and the > > following error: > > > > [myapp] WARN [btpool0-1] LookupUtil.<init>(99) | Exception: [.LookupUtil] > > Error looking up property "id" in object type > > "java.lang.String". Cause: Unknown property 'id' > > java.lang.NoSuchMethodException: Unknown property 'id' > > at > > org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122) > > at > > org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:408) > > at org.displaytag.util.LookupUtil.getProperty(LookupUtil.java:271) > > at > > org.displaytag.util.LookupUtil.getBeanProperty(LookupUtil.java:129) > > at org.displaytag.model.Column.getValue(Column.java:124) > > at > > org.displaytag.model.Column.createChoppedAndLinkedValue(Column.java:201) > > at org.displaytag.model.Column.initialize(Column.java:178) > > at > > org.displaytag.render.TableWriterTemplate.writeTableBody(TableWriterTemplate.java:313) > > at > > org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:138) > > at > > org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:643) > > at org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1557) > > at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1206) > > at > > org.apache.jsp.WEB_002dINF.pages.admin.productList_jsp._jspService(org.apache.jsp.WEB_002dINF.pages.admin.productList_jsp: > > 206) > > <.. lots more ..> > > > > Unfortunately, at no point does the stacktrace drop into any of my own > > classes, nor do any of my debug messages appear. > > > > The following snippet is from my ProductList.jsp: > > > > <c:set var="products" value="products" scope="request"/> > > <display:table name="products" class="table" requestURI="" id="productList" > > export="true" pagesize="25"> > > <display:column property="id" sortable="true" > > href="editProduct.html" media="html" > > paramId="id" paramProperty="id" titleKey="product.id"/> > > <display:column property="id" media="csv excel xml pdf" > > titleKey="product.id"/> > > <display:column property="name" sortable="true" > > titleKey="product.name"/> > > <.. lots more ..> > > > > My initial interpretation of the error message is that the "products" list > > being returned by the c:set line in the jsp is actually coming in as > > a list of strings and the server is complaining that the first String > > doesn't contain an ID (which it wouldn't of course). However, I've been > > back through my classes and the relevant methods are definitely returning > > List<Product>. > > > > The first line of my ProductAction.list() method is a log.debug call that > > never prints to the log so I'm at a loss to figure out what's going > > on. > > > > Has anyone else seen anything like this before? Any thoughts on what might > > be causing this problem, or where I should look? Cheers, Rob Hills Waikiki, Western Australia Mobile +61 (412) 904-357 Fax: +61 (8) 9529-2137 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]