object passing from one page to the other page

Dear All,

I am a beginner of JSF. I am writing a jsf page. What I want to do is that I click a command link in a row of table record then going to the other page which contains its details. so, some value or object of previous record must be passed from one page to other page. how to achieve that? can I use "FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(key);" I heard that from somewhere but I don't exactly know how it works. Can anybody help me? Thanks.

Chris

[522 byte] By [Chrisinchrista] at [2007-10-3 7:44:50]
# 1

You can store selected item like this. Where SELECTED_ITEM_KEY a constant to identify selected item in session.

public String doShowDetails() {

final Map sessionExt = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();

sessionExt.put(SELECTED_ITEM_KEY,item);

return "doShowItemDetails";

}

and to retrieve the stored item

final Map sessionExt = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();

Object item=sessionExt.get(SELECTED_ITEM_KEY);

regards,

Stas

StanislavLa at 2007-7-15 2:46:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...