# 如何使用ICEFaces進行導航並傳遞參數

## 最佳答案

So you have Page A with the table of stuff and Page B with charts of individual stuffs. Flow being: Navigate to Page A -> Look through the table -> Click something on Page A to look at charts -> Navigate to Page B -> Read Charts.

One, you can make the chart page RESTful and pass in the ID of the stuff you're going to chart. IE, a column on your page would have:

Review Chart

（<�碼> FacesContext.getCurrentInstance（）。getExternalContext（）。getRequestParameterMap（）。得到（“stuffID）</代碼>

Two, you can simply make your bean session scoped (or, conversation scoped if you're using Seam or similar) so that the two pages simply share the one bean. This is probably the simplest but you will need to ensure that the bean is cleaned up when you no longer need it and thus, somewhat dangerous.

Three, you can use a regular HTTP form and POST to the charting page, using the same kind of RequestParameterMap dredging that you did for number one. This works the same way as number one but isn't quite as clean as you will need a similar form everywhere you want to do this and it cannot be a normal hyperlink.