aspose file tools*
The moose likes Struts and the fly likes Displaying Data From Different Tables in .jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying Data From Different Tables in .jsp" Watch "Displaying Data From Different Tables in .jsp" New topic
Author

Displaying Data From Different Tables in .jsp

Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
Hi All,

I'm having a little trouble (for some reason) understanding how to do something in my Struts 1.3 application.

Specifically, I have a .jsp that looks (in part) like below:




The action in struts-config looks like this:





The question I have is how do I display data from different classes (beans) in my drop down lists on my .jsp. My action points to a specific actionForm (in this case "ProblemForm") but I want to display data from another bean (in this case UseCases) in my drop down list on the same .jsp page. Also, I'm using hibernate 3 and there is a "many-to-many" relationship between "Problem" bean and "UseCase" bean. The relevant section of the "ProblemActionForm" is shown below as well:




I guess what I'm asking is given the above what should the code be in my .jsp to show the various "use case" values? Apparently this code above:



is incorrect.


Any help is appreciated,

Thanks,

Rob
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617


Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
Hi David,

Thanks for the response . . . sorry for not responding sooner . . . I've been out of the office . . .

I did exactly as you suggested and now I get the following error:

"javax.servlet.jsp.JspException: No getter method available for property useCaseId for bean under name org.apache.struts.taglib.html.BEAN"

Do you know why I'm getting this error?

Thanks,

Rob


Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
Hi David,

I was able to solve this problem . . . thanks for your assistance . . .

Rob
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please follow up in case someone else encounters the same issue. Thanks! Glad you got it working.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Displaying Data From Different Tables in .jsp