You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ganesh <em...@yahoo.co.in> on 2011/09/29 08:02:21 UTC

To create new session without invalidating existing one

Hello all,

We have a requirement to launch a new browser window with new session but the exisiting session with parent browser should not be disturbed. We tried couple of methods the new session is created but the existing session is modified. Could some one throw me light on this.

Regards
Ganesh

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: To create new session without invalidating existing one

Posted by Aaron Brown <aa...@thebrownproject.com>.
This should be a whole new email thread, shouldn't it?

Try naming the class variable "id" and making your method "getId". OGNL will
try to make a guess what the pojo get method is and it often gets confused
with all uppercase names.

Aaron
 On Oct 3, 2011 6:34 AM, "Ganesh" <em...@yahoo.co.in> wrote:
> I tried setting the below hidden variable inside and outside the form. In
both the case, Im not getting any value from request.getParameter. If i put
inside the form then i am able to access it using form.getID.
>
> <input type="hidden" id="ID" value="<%=ID%>"/>
>
> Regards
>
> Ganesh
>
>
>
> ----- Original Message -----
> From: "Dave Newton" <da...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Friday, September 30, 2011 6:33 PM
> Subject: Re: To create new session without invalidating existing one
>
>
>> On Fri, Sep 30, 2011 at 7:46 AM, Ganesh wrote:
>>
>>> Is there any way to retireve the form data using request.getParameter();
If
>>> the ID is part of hidden variable then it is returning null. Any ways to
>>> retrieve data without using Form object.
>>>
>>
>> If it's part of the form, and you're setting it, but not able to retrieve
>> it, it's likely you're doing something wrong.
>>
>>
>>> First time, I will set the ID as part of the URL and my problem is the
ID
>>> has to be carried for every subsequet pages. How to achieve this?
>>>
>>
>> URL rewriting.
>>
>> Dave
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

Re: To create new session without invalidating existing one

Posted by Ganesh <em...@yahoo.co.in>.
I tried setting the below hidden variable inside and outside the form. In both the case, Im not getting any value from request.getParameter. If i put inside the form then i am able to access it using form.getID. 

<input type="hidden" id="ID" value="<%=ID%>"/>

Regards

Ganesh



----- Original Message ----- 
From: "Dave Newton" <da...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Friday, September 30, 2011 6:33 PM
Subject: Re: To create new session without invalidating existing one


> On Fri, Sep 30, 2011 at 7:46 AM, Ganesh wrote:
> 
>> Is there any way to retireve the form data using request.getParameter(); If
>> the ID is part of hidden variable then it is returning null. Any ways to
>> retrieve data without using Form object.
>>
> 
> If it's part of the form, and you're setting it, but not able to retrieve
> it, it's likely you're doing something wrong.
> 
> 
>> First time, I will set the ID as part of the URL and my problem is the ID
>> has to be carried for every subsequet pages. How to achieve this?
>>
> 
> URL rewriting.
> 
> Dave
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: To create new session without invalidating existing one

Posted by Dave Newton <da...@gmail.com>.
On Fri, Sep 30, 2011 at 7:46 AM, Ganesh wrote:

> Is there any way to retireve the form data using request.getParameter(); If
> the ID is part of hidden variable then it is returning null. Any ways to
> retrieve data without using Form object.
>

If it's part of the form, and you're setting it, but not able to retrieve
it, it's likely you're doing something wrong.


> First time, I will set the ID as part of the URL and my problem is the ID
> has to be carried for every subsequet pages. How to achieve this?
>

URL rewriting.

Dave

Re: To create new session without invalidating existing one

Posted by Ganesh <em...@yahoo.co.in>.
Thanks for all  your suggesstions

I am using Struts 1.x and i am planning to have session id. I need to set it as part of URL / set as a hidden variable in all JSP. Based on the ID, I will store a map of ID with Account objects in the session. 

Is there any way to retireve the form data using request.getParameter(); If the ID is part of hidden variable then it is returning null. Any ways to retrieve data without using Form object. 

First time, I will set the ID as part of the URL and my problem is the ID has to be carried for every subsequet pages. How to achieve this?

Regards
Ganesh 

----- Original Message ----- 
From: "roger" <ro...@googlemail.com>
To: <us...@struts.apache.org>
Sent: Friday, September 30, 2011 1:25 PM
Subject: Re: To create new session without invalidating existing one


> You may want to take a look at the Scope plugin. This won't give you a new
> session, but it does provide an implementation of conversation scope which
> may suffice.
> 
> Regards
> 
> --
> View this message in context: http://struts.1045723.n5.nabble.com/To-create-new-session-without-invalidating-existing-one-tp4851881p4856176.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: To create new session without invalidating existing one

Posted by roger <ro...@googlemail.com>.
You may want to take a look at the Scope plugin. This won't give you a new
session, but it does provide an implementation of conversation scope which
may suffice.

Regards

--
View this message in context: http://struts.1045723.n5.nabble.com/To-create-new-session-without-invalidating-existing-one-tp4851881p4856176.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: To create new session without invalidating existing one

Posted by Brian Thompson <el...@gmail.com>.
On Thu, Sep 29, 2011 at 3:58 AM, Marcus Bond <ma...@marcusbond.me.uk>wrote:

> What is the reason for the new session? Doesn't sound a great plan.
> Anyway you're going to have a problem as this isn't how browsers expect to
> work, that said Chrome allows incognito browsing so that might work but it
> isn’t generally the expected behaviour.
>
> If the same application is being accessed from the same browser (Firefox,
> Chrome, IE etc.) once a session is created then that is the same session
> unless you destroy it. Your browser has a cookie with the jsessionid and
> that cookie is for the site from that browser across all windows not per
> browser window.
> Marcus.
>


I should probably note that my suggestion for managing two sessions is
really more like "reimplement session functionality manually", so it's not a
very efficient course.

Brian

RE: To create new session without invalidating existing one

Posted by Marcus Bond <ma...@marcusbond.me.uk>.
What is the reason for the new session? Doesn't sound a great plan.
Anyway you're going to have a problem as this isn't how browsers expect to work, that said Chrome allows incognito browsing so that might work but it isn’t generally the expected behaviour.

If the same application is being accessed from the same browser (Firefox, Chrome, IE etc.) once a session is created then that is the same session unless you destroy it. Your browser has a cookie with the jsessionid and that cookie is for the site from that browser across all windows not per browser window.
Marcus.

-----Original Message-----
From: Velmurugan M [mailto:velmuruganm@gmail.com] 
Sent: 29 September 2011 09:23
To: Struts Users Mailing List
Subject: Re: To create new session without invalidating existing one


-----Original Message-----
From: Brian Thompson <el...@gmail.com>
Date: Thu, 29 Sep 2011 01:26:48
To: Struts Users Mailing List<us...@struts.apache.org>
Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
Subject: Re: To create new session without invalidating existing one

Well, first I'd suggest dropping the requirement for launching the new browser window.  It's a pretty user-hostile way to program a site.  "Hey, why'd my Back button stop working?  Sigh, call IT again."

That said, you could try launching the popup window with a URL on a different subdomain.  That should keep the sessions separate from each other.

Failing that, you'll have to build in some logic to manage two sessions with different keys for the session IDs.

Regardless, I don't think it's really a Struts-level issue.

Brian



On Thu, Sep 29, 2011 at 1:02 AM, Ganesh <em...@yahoo.co.in> wrote:

> Hello all,
>
> We have a requirement to launch a new browser window with new session 
> but the exisiting session with parent browser should not be disturbed. 
> We tried couple of methods the new session is created but the existing 
> session is modified. Could some one throw me light on this.
>
> Regards
> Ganesh
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: To create new session without invalidating existing one

Posted by Velmurugan M <ve...@gmail.com>.
-----Original Message-----
From: Brian Thompson <el...@gmail.com>
Date: Thu, 29 Sep 2011 01:26:48 
To: Struts Users Mailing List<us...@struts.apache.org>
Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
Subject: Re: To create new session without invalidating existing one

Well, first I'd suggest dropping the requirement for launching the new
browser window.  It's a pretty user-hostile way to program a site.  "Hey,
why'd my Back button stop working?  Sigh, call IT again."

That said, you could try launching the popup window with a URL on a
different subdomain.  That should keep the sessions separate from each
other.

Failing that, you'll have to build in some logic to manage two sessions with
different keys for the session IDs.

Regardless, I don't think it's really a Struts-level issue.

Brian



On Thu, Sep 29, 2011 at 1:02 AM, Ganesh <em...@yahoo.co.in> wrote:

> Hello all,
>
> We have a requirement to launch a new browser window with new session but
> the exisiting session with parent browser should not be disturbed. We tried
> couple of methods the new session is created but the existing session is
> modified. Could some one throw me light on this.
>
> Regards
> Ganesh
>
>


Re: To create new session without invalidating existing one

Posted by Brian Thompson <el...@gmail.com>.
Well, first I'd suggest dropping the requirement for launching the new
browser window.  It's a pretty user-hostile way to program a site.  "Hey,
why'd my Back button stop working?  Sigh, call IT again."

That said, you could try launching the popup window with a URL on a
different subdomain.  That should keep the sessions separate from each
other.

Failing that, you'll have to build in some logic to manage two sessions with
different keys for the session IDs.

Regardless, I don't think it's really a Struts-level issue.

Brian



On Thu, Sep 29, 2011 at 1:02 AM, Ganesh <em...@yahoo.co.in> wrote:

> Hello all,
>
> We have a requirement to launch a new browser window with new session but
> the exisiting session with parent browser should not be disturbed. We tried
> couple of methods the new session is created but the existing session is
> modified. Could some one throw me light on this.
>
> Regards
> Ganesh
>
>