Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Session Binding Question

843844Jan 26 2010 — edited Jan 27 2010
I want to bind dynamically to elements of a HashMap. I want each new component to bind to the new
map entry's value.
I tried to bind my components to the map facade 'myOpt' below but the Browser crashed saying
it couldn't find the session object. Binding like this:
"#{sessBean.myOpt[myKey]}".

When I tried to add access methods and bind directly to myMap, it executed but
the output showed the cumulative map contents for each new component. So it bound to the
entire map. Can someone help me understand how to bind each new component to a map entry?

Then I tried to bind directly

private HashMap<String, Option[]> myMap = new HashMap<String, MyList[]>();

MyList[] myOpt = new MyList[] {};
public MyList[] getMyOpt(String tid)
{
return myMap.get(tid);
}
public void setMyOpt(String tid, MyList[] opt)
{
myMap.put(tid, opt);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2010
Added on Jan 26 2010
3 comments
136 views