File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Showing two properties from different beans on same .jsp page in Struts 1

 
Robert Wiscup
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm a little confused on how to show two properties from different beans on the same .jsp page.

I have a .jsp page in a Struts 1 application . . . code follows:




"description" is in the "ProblemDescription" Bean and "problemResolution" is in the "Problem" Bean.

The action mapping for this page is shown below:




Note that the "name" attribute points to "ProblemDescriptionForm" and not "ProblemForm"

When I try to load the page I get "No getter method available for property problemResolution for bean under name org.apache.struts.taglib.html.BEAN"

I assume I'm getting this because the action mapping uses name = "ProblemDescriptionForm" and not "ProblemForm" and "problemResolution" is part of the "ProblemForm".

So I'm confused as to how I show properties from two different beans on the same .jsp page when the name attribute in the action mapping can only point to one form (i.e. bean). Can someone explain how this is supposed to work?

Thanks in Advance,

Rob



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You put the bean into scope (generally request scope). Or you put the other bean you're talking about into the form bean.
 
Robert Wiscup
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that David . . . everything is working now . . .

Thanks Again,

Rob
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic