aspose file tools*
The moose likes Servlets and the fly likes JSP: Passing object to a bean using setter method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP: Passing object to a bean using setter method" Watch "JSP: Passing object to a bean using setter method" New topic
Author

JSP: Passing object to a bean using setter method

Ayaz Khaja
Greenhorn

Joined: Feb 16, 2001
Posts: 4
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
I don't think setProperty works that way. Why not just write the normal Java code to pass the object?
Bill
Ayaz Khaja
Greenhorn

Joined: Feb 16, 2001
Posts: 4
I guessed so. Thanks for your reply Bill.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP: Passing object to a bean using setter method