aspose file tools*
The moose likes JSP and the fly likes How to setProperty of nested properties? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to setProperty of nested properties?" Watch "How to setProperty of nested properties?" New topic
Author

How to setProperty of nested properties?

Alex Pi
Greenhorn

Joined: Jan 08, 2013
Posts: 17

I've got 2 JavaBean-classes:

Then i retrieve request parameters in JSP:


How can i set properties for person.address (nested property)? (person.firstName & person.secondName are correct).
Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

As you are using the JSTL and EL why are you bothering with useBean and setProperty at all?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Pi
Greenhorn

Joined: Jan 08, 2013
Posts: 17

Bear Bibeault wrote:As you are using the JSTL and EL why are you bothering with useBean and setProperty at all?

You have catched me. :) I learn JSP, and i still didn't know JSTL.
I know how to use scriptlets but i do first steps (only couple days) with EL.

Perhaps it will be better to ask how could i set nested properties without using scriptlets.
Sai Prasad Sabeson
Greenhorn

Joined: Oct 10, 2011
Posts: 4

Using EL you can set the value of the property inside person


This will set all the params there in the request scope to the bean.Your Address property will be null untill now.

Now,

this can set the values to the bean 'person'.Before you set the value adress ,make sure that you have address bean set up

Hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to setProperty of nested properties?
 
Similar Threads
One-to-One mapping problem
Jasper compile error
HFSJ Question in JSTL
JSF, EJB3 target unreachable, returned null
Dynamically populate java bean tree