Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need to set <s:property> value in the action class

 
Prashant K. Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dear,

what I am doing is that I have taken out all the products listed under product category and have displayed them in a jsp.

Now I want to click the product and display all the supplier that supply the product.

Anysuggestions how do i do that in struts 2.0

My jsp is as follows:



My Action class is as follows:


My Supplier.java is as follows:

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the product id as a parameter in the link to display product details.
 
Prashant K. Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

could you please elaborate this. I dont know how to use the id as a parameter.

Thanks and regards,
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a few ways to do it; here's two.All of these topics are covered in the Struts 2 documentation, which I'd recommend reading before getting too much further into your project. There are at least a couple more variations, but this should be enough to get you started.
 
Prashant K. Singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,

I am able to reach the action class but the productId values is coming null ie the productID is not populating. Please check.

Here is my producthandled.jsp



Here is my Showpdtsuppliers.java



Here is my Suppliers.java

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Continuing on struts-user.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic