You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Stephane Grialet <St...@ac-toulouse.fr> on 2001/04/06 11:02:54 UTC

Parameters loss between portlets/actions/screens

Hello,

I'm a new subscriber in this ML, my name Stéphane Grialet and i'm working for the french National Education, in the Toulouse academy site, on a Jetspeed project to realise a virtual desk.

I'm developping dynamic pages for this virtual desk, mainly Java portlets, actions and screens.
And i'm having problems with keeping my parameters context during the navigation between the different pages.

In my Java programs (doBuild or getContent method specially), i use the
    rundata.getParameters().getString(paramName,"")
method for reaching the value of the parameter named "paramName".

But this doesn't work.
When i use this method to get the username for instance of the logged person who calls the page, i get "null" instead of his real username.
I have tried another method:
    rundata.getUser().getUserName()
and this one works all the time 

So i have a way to solve my problem for the username and password stuff, but how can i manage to keep other parameters alive (accessible from any Java page) during the whole user Jetspeed session ?

Can you explain to me why, while these two methods are applied to the same object (rundata), the getParameters() one doesn't work and the getUser() works ?...
How is the "ParameterParser" object managed within Jetspeed ?

Thanks a lot for your help,
Stéphane

RE: Parameters loss between portlets/actions/screens

Posted by Neeme Praks <ne...@one.lv>.
Well, in order to store some data together with the user, I would recommend
you to use one of the following methods:
* session data - data.getUser().getTemp("paramName") &
data.getUser().setTemp("paramName", "paramValue")
* persistent data - data.getUser().getPerm("paramName") &
data.getUser().setPerm("paramName", "paramValue")

As already stated by Stephan, ParameterParser (data.getParameters()) is only
used for accessing request variables.

Neeme

> -----Original Message-----
> From: Stephan Hesmer [mailto:shesmer@raleigh.ibm.com]
> Sent: Friday, April 06, 2001 2:28 PM
> To: jetspeed-dev@jakarta.apache.org
> Subject: Re: Parameters loss between portlets/actions/screens
>
>
> Stephane,
>
> the rundata.getParameters() method is used to get information
> about the
> parameters of the URL. This kind of parameter is turbine
> specific. So if you
> have a URL like
> http://hostname/servletname/screen/home/action/myaction
> then you would receive the parameters screen and action with
> the appropriate
> value (home and myaction).
>
> You want to store data in the session, so just use the session via
> rundata.getSession()
>
> BTW, to get information about the user in turbine/jetspeed
> you have to use
> the user object of turbine via rundata.getUser()
>
> Stephan
>
> ----- Original Message -----
> From: Stephane Grialet
> To: jetspeed-dev@jakarta.apache.org
> Sent: Friday, 06 April, 2001 11:02
> Subject: Parameters loss between portlets/actions/screens
>
>
> Hello,
>
> I'm a new subscriber in this ML, my name Stéphane Grialet and
> i'm working
> for the french National Education, in the Toulouse academy site, on a
> Jetspeed project to realise a virtual desk.
>
> I'm developping dynamic pages for this virtual desk, mainly
> Java portlets,
> actions and screens.
> And i'm having problems with keeping my parameters context during the
> navigation between the different pages.
>
> In my Java programs (doBuild or getContent method specially),
> i use the
>     rundata.getParameters().getString(paramName,"")
> method for reaching the value of the parameter named "paramName".
>
> But this doesn't work.
> When i use this method to get the username for instance of
> the logged person
> who calls the page, i get "null" instead of his real username.
> I have tried another method:
>     rundata.getUser().getUserName()
> and this one works all the time
>
> So i have a way to solve my problem for the username and
> password stuff, but
> how can i manage to keep other parameters alive (accessible
> from any Java
> page) during the whole user Jetspeed session ?
>
> Can you explain to me why, while these two methods are
> applied to the same
> object (rundata), the getParameters() one doesn't work and
> the getUser()
> works ?...
> How is the "ParameterParser" object managed within Jetspeed ?
>
> Thanks a lot for your help,
> Stéphane
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Re: Parameters loss between portlets/actions/screens

Posted by Stephan Hesmer <sh...@raleigh.ibm.com>.
Stephane,

the rundata.getParameters() method is used to get information about the
parameters of the URL. This kind of parameter is turbine specific. So if you
have a URL like
http://hostname/servletname/screen/home/action/myaction
then you would receive the parameters screen and action with the appropriate
value (home and myaction).

You want to store data in the session, so just use the session via
rundata.getSession()

BTW, to get information about the user in turbine/jetspeed you have to use
the user object of turbine via rundata.getUser()

Stephan

----- Original Message -----
From: Stephane Grialet
To: jetspeed-dev@jakarta.apache.org
Sent: Friday, 06 April, 2001 11:02
Subject: Parameters loss between portlets/actions/screens


Hello,

I'm a new subscriber in this ML, my name Stéphane Grialet and i'm working
for the french National Education, in the Toulouse academy site, on a
Jetspeed project to realise a virtual desk.

I'm developping dynamic pages for this virtual desk, mainly Java portlets,
actions and screens.
And i'm having problems with keeping my parameters context during the
navigation between the different pages.

In my Java programs (doBuild or getContent method specially), i use the
    rundata.getParameters().getString(paramName,"")
method for reaching the value of the parameter named "paramName".

But this doesn't work.
When i use this method to get the username for instance of the logged person
who calls the page, i get "null" instead of his real username.
I have tried another method:
    rundata.getUser().getUserName()
and this one works all the time

So i have a way to solve my problem for the username and password stuff, but
how can i manage to keep other parameters alive (accessible from any Java
page) during the whole user Jetspeed session ?

Can you explain to me why, while these two methods are applied to the same
object (rundata), the getParameters() one doesn't work and the getUser()
works ?...
How is the "ParameterParser" object managed within Jetspeed ?

Thanks a lot for your help,
Stéphane


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org