• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts nested:notEmpty tab

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting the following error message:

javax.servlet.jsp.JspException: No getter method for property publications[0].publication.authors.lastName of bean report

It is saying there is no lastName getter method. The authors object is a List of:

public class PuidAuthor implements Serializable {
private String lastName;
private String firstName;
...

It has a method:

public String getLastName () {

Why is this getter method not being found or used by the code?

Thanks and God Bless you!
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
The Class seems Okay.
Can u give the code u are using in the JSP to get the value?

Thanks
 
John LeBaptiste
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Soumya, I sent you a private IM with the JSP code snippet that you requested.

John
 
Soumya Saha
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
Try this.

<nested:iterate property="authors">
<li><nested:write property="order" ignore="true"/>
<nested:write property="lastName"/>, <nested:write property="firstName"/>
<nested:write property="initials" ignore="true"/></li>
</nested:iterate>

If it does not work, try using logic:iterate: this link might help u.
Link

Thanks
 
John LeBaptiste
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Soumya! It really helped and the link is great too. The solution below got me pretty much what I wanted.

<nested:notEmpty property="publication.authors">
Authors:<ul>
<nested:iterate property="publication.authors">
<nested:notEmpty property="lastName">
<li><nested:write property="order" ignore="true"/>
<nested:write property="lastName"/>, <nested:write property="firstName"/>
<nested:write property="initials" ignore="true"/></li>
</nested:notEmpty>
</nested:iterate>
</ul>
</nested:notEmpty>
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic