On 11/8/06, Ramineni Viswanath <[EMAIL PROTECTED]> wrote:

While on a page, I call the same page with a different
set of query parameters, it is being treated as a
postback.

For example my current url is

/mainmenu.faces?menuid=0

I have a HtmlOutputLink on this page with the value
set to /mainmenu.faces?menuid=26. When I click on this
link, isPostBack() is showing "true". Is this the
correct and intended behaviour?


The mechanism used to declare a request being a postback is whether the
ViewController.restoreView() method provided by JSF determines that there
was an existing view that could be restored.  In turn, if you are using
server side state saving with current 1.1 implementations, this decision is
based solely on the view identifier, not on any related parameters.  Thus,
if you are using server side state saving, JSF will treat your two URLs as
being the same, and will restore the previous state (and, therefore, the
postback property will be set to true).

If you were to use client side state saving, on the other hand, the two URLs
would be considered distinct views (since the HtmlOutputLink ends up doing a
GET to the second URL), with no state to be restored, and therefore postback
would be false.

--Vish


Craig

Reply via email to