dev@jsftemplating.java.net

Re: JSFTemplating: Some questions on passing variables

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Mon, 22 Jan 2007 11:38:12 -0800

Hi Karam,
please see inline.

Karam Singh Badesha wrote:
> Hi,
>
>
> #1:
>
> When I have to pass some variables to the next page from an hyperlink,
> how do I use them in the next page?
>
> e.g.
>
> page2.jsf?var1=This&var2=is&var3=a&var4=test
>
> Do I just use them like the following:
>
> #{requestScope.var1}
> ...
>
I normally retrieve it with $requestParameter{var1}
eg. setPageSessionAttribute(key="var1" value="$requestParameter{var1}")
and then when button press causes the form to submit, i can get back
this variable by using $pageSession{var1}

> #2:
>
> PageSession variables don't get passed to different pages, correct?
>
It won't get pass to different page. But if it goes back to the same
page, it stays. eg. it will still be there if you click the 'sort'
symbol on a table and the page refresh with the new sorting.
> #3:
>
> When I have session variables, what is the process of defining them and
> using them?
>
> Here is my understanding, please let me know something is not correct:
>
> page1: declare session variables
> page1: use session variables
>
> page2: accept session variables
> page2: use session variables
>
> Now, if I am passing some variables with hyperlink (#1 above), session
> variables will still work the way they are supopsed to, correct?
>
>
session variable stays through the current session. I try to avoid
using session variable if i can, we only use very few session variable
in admin console. I find the page session variable to be really useful
and sufficient for many case.

Anissa
> Thats it for now.
>
> thanks
> Karam
>