This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Meteor in Action and have Stephan Hochhaus & Manuel Schoebel on-line!
See this thread for details.
The moose likes JSP and the fly likes set bean property with request attribut Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Meteor in Action this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "set bean property with request attribut" Watch "set bean property with request attribut" New topic

set bean property with request attribut

Marko Debac
Ranch Hand

Joined: Aug 21, 2006
Posts: 121
Hi ranchers,

I got this little problem:
I have

and I want to replace curent property of session scoped attribute "user" - users list.

my bean "user" is:

How can I do that within JSTL?
I supose with useBean and setProperty, but I am confused with getting list from request scope and puting her on the right place in user bean from session scope.

Because I cant do this:

please help,
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62464

I'm not sure if this is exactly what you are after, and you haven't provided enough info for a definitive answer, but something in the form of:

may be what you are asking.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Marko Debac
Ranch Hand

Joined: Aug 21, 2006
Posts: 121
I think not, because I have two beans, but one bean HAS A list[] of second beans for his property. And I have instance of that first bean filled up from database (and all his property), and set in session scope.

Now, I get new list[] from somewhere (web services operation called from jsp)and I set it like request attribute by name "list".
Further, I need to put (replace existing) list in session scope attribute (upper described instance - session.setAttribute("user", user)), with no scriptlet

Stefan Evans

Joined: Jul 06, 2005
Posts: 1310
Surely this does it?

its approximately equivalent to user.setList(request.getAttribute("list"));
I agree. Here's the link:
subject: set bean property with request attribut