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

JSP: Passing object to a bean using setter method

 
Ayaz Khaja
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to pass a java object to a bean using setter method through a JSP page?
<jsp:useBean id="cashier" scope="page" class="cart.Cashier" />
<jsp:setProperty
name="cashier"
property="cart"
param="cart" />
I am trying to accomplish this using the above code in a JSP page and I get the following error on JSWDK:1.0.1:
JspException: setProperty: variable of Class: class cart.ShoppingCart can't be set.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think setProperty works that way. Why not just write the normal Java code to pass the object?
Bill
 
Ayaz Khaja
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guessed so. Thanks for your reply Bill.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic