requestScope mystery solved

again RTFM!!!! but hey… the FM not always tells you what you want to know!

Might that be the reason why we developers tend to NRTFM?

dunno..

anyhow… after DAYS of testing / searching (is it called googling nowadays?) / changing code and iterating a (felt) thousand times…

I finally came accross the solution how to “persist” the requestScope from one xPage to another…

First (I hope I am not wrong with this) a bit of background:

The parameters set in the requestScope would (normally) get submitted via the URL (in a GET request). As those JSF (and xPages) mostly work via POST request we (unless we use nice tools, such as the TCP Monitor in the designer!) never really see them. That’s one of the reasons so many Domino developers struggle to get the requestScope working. We cannot really debug it properly.

Thanks to TCP Monitor and a friend helping me, we finally figured:

After an xPage has been submitted and the navigation rule would redirect it to another page this redirection was a request to the client browser!

Imagine: The server tells the browser: please ask now for page xyz.xsp

And with the little background above you can understand that the server didn’t tell the browser which requestParameters it should transmit as well, alas they would be (ARE!!!) lost.

But as i said.. I did a lot of research on this and I found the following setting: (You find it under the “Package explorer” view in the designer

if you turn this feature off the server does not ask the browser for asking the new page but the server actually redirects himself to the new page and hence will preserve the requestScope values….

So you can actually have the dimmwitted example of two xPages where on one page you enter the name and submit it, and the second page will greet you with “Hello yourname” works!

I for myself will use this feature to tell my xpView.xsp (the one which handles all views in my db) will know which view it has to display after a document has been submitted (at least if nothing else has been defined)

Comments

  1. Hello Michael

    FireBug is my most loved debuging tool for such issues. In the most cases I see all traffic with a nice ui.

    Why not using "sessionScope" Variables for transaction that goes over a single page or request?

    LG
    Christian

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.