views:

88

answers:

1

I have an IceFaces page which is powered by several Request scoped beans. When I make an initial GET request, I grab the external context via the faces context grab a GET parameter and use it to initialize my beans in their @PostConstruct method.

However, if I try to link to the same page with a different get parameter, it seems to be eating my request and treating it as a postback. None of the request scoped beans go out scope (exactly like they don't go out of scope on a post back) and the new value is ignored.

How do I get it to treat my link as a brand new request which needs new request scoped beans?

A: 

Use h:outputLink instead of h:commandLink.

By the way, a <managed-property> in faces-config.xml is the preferred way for setting GET parameters in a managed bean. Whenever you need to get ExternalContext in a managed bean, then it's time to think twice if there aren't other builtin and more transparent ways to achieve the same.

BalusC
This problem happens even if I type the parameter in on the browser bar and do navigation that way. I'll check out the `<managed-property>` bit to see if that might be causing it but I've tried both `ice:outputLink,` `ice:commandLink` and direct browser navigation.
Drew