wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 12760
    
    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
 
Similar Threads
How to display the resulting JSP of a servlet in another frame?
Problem in injecting interface
Bean setter methods........
show cart in shopping cart
Strange problem in retrieving the table data in a jsp