RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-08 Thread Peter Chen
I show these three audio files on the JSP page, just as following show.

 

 

The script I used to show these audio files is like this:

 

script language=JavaScript

document.write('object width=320 height=45 
classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95');

document.write('param name=filename 
value=getParts.jsp;jsessionid=87ACD9BD3590FBE1051F33B2AA7AE488?timestamp=1260252638867contentid=137063timemark=20091110index=4
 /');

document.write('PARAM NAME=AUTOSTART value=false');

document.write('embed width=320 height=45 
type=application/x-mplayer2 
src=getParts.jsp;jsessionid=87ACD9BD3590FBE1051F33B2AA7AE488?timestamp=1260252638867contentid=137063timemark=20091110index=4
 AutoStart=0');

document.write('/embed');

document.write('/object');

/script

 

 

I select the icon of Ashanti.WAV, and press the right key of mouse, and it show 
the menu like this:

 

 

 

 

After I pressed the menu item “Properties”, a dialog box will show, and we see 
the Location of the audio file.

 

 

 

We can see that, jsessionid= 87ACD9BD3590FBE1051F33B2AA7AE488, but after I 
pressed the “play” button of the audio file, it doesn’t work. That is, this 
file can’t be played.

 

I traced in the log file, and found the real session id is 
1FADDAF2B01872E5E8ECEB72C72BF98C.

 

Each time I pressed the play button, there are two lines added in the log, like 
this: 

TRACE 091208 17:19:25,476 http-8080-8  
sessionid:1FADDAF2B01872E5E8ECEB72C72BF98C 

WARN  091208 17:19:25,476 http-8080-8  message from session is null!

 

So I can make sure that, there is something wrong with the session information.

 

 

I have tested this for lots of times with the browser FireFox3.5, and it always 
works like this.

 

 

But if I change to use IE6/IE7/IE8, this problem never happened. Does someone 
know the reason? thanks.

 

 

 

 

-Original Message-
From: Looijmans, Mike [mailto:mike.looijm...@oce.com] 
Sent: 2009年12月8日 15:03
To: Tomcat Users List
Subject: RE: the Tomcat generates more than one session id with the same http 
request, please help me

 

Seems like a propietary way of storing the session ID, I'm not much into JSP 
stuff so I really don't know. Someone else here may be able to explain.

 

You can store whatever you need in parameters, either by putting into URLs or 
by creating (hidden) controls on web forms. This is the preferred method of 
parameter passing, as it allows multiple instances (e.g. browser tabs) to 
coexist. You should only store things in a session that are related to the 
connection and user (e.g. user credentials, preferences and such), but 
absolutely not the page he's navigating now.

 

You can also add a path to the URL, e.g.

 

getparts.jsp/137063/4

 

Then getPathInfo() will return 137063/4 in getparts.jsp.

 

M

 

 -Original Message-

 From: Peter Chen [mailto:peter.c...@aicent.com] 

 Sent: dinsdag 08 december 2009 07:49

 To: Tomcat Users List

 Subject: RE: the Tomcat generates more than one session id 

 with the same http request, please help me

 

 Thanks for Mike's reply.

 

 I searched on the Internet, and I got a method, the detail is 

 as follows:

 script language=JavaScript

 document.write('object width=320 height=45 

 classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95');

 document.write('param name=filename 

 value=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1A

 D?timestamp=1260252638867contentid=137063timemark=20091110i

 ndex=4 /');

 document.write('PARAM NAME=AUTOSTART value=false');

 document.write('embed width=320 height=45 

 type=application/x-mplayer2 

 src=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?

 timestamp=1260252638867contentid=137063timemark=20091110ind

 ex=4 AutoStart=0');

 document.write('/embed');

 document.write('/object');

 /script

 

 The most important sentence is 

 getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?time

 stamp=1260252638867contentid=137063timemark=20091110index=4

 

 I know the URL like 

 getParts.jsp?timestamp=1260252638867contentid=137063timemar

 k=20091110index=4, this URL is used to pass parameters from 

 one Jsp to another one. And we can get parameters with 

 sentences like request.getParameter(timestamp); 

 request.getParameter(contentid ).

 

 But I don't know the part 

 getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD, 

 is it also used to pass parameter?

 

 If so, how to get the parameter? Thanks.

 

 

 

 -Original Message-

 From: Looijmans, Mike [mailto:mike.looijm...@oce.com]

 Sent: 2009年12月7日 16:39

 To: Tomcat Users List

 Subject: RE: the Tomcat generates more than one session id 

 with the same http request, please help me

 

 Put the session ID in the URL and it will work on all systems.

 

 Alternatively, don't use sessions for the audio file.

  

 

  -Original Message-

  From: Peter Chen [mailto:peter.c

RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-08 Thread Looijmans, Mike
The reason is that other browsers use a media player component that
reconnects to the server. The session is linked to the browser
instance. As a result, the session is lost when the mediaplayer connects
to get the audio data.
 
Whap happens in other browsers is the equivalent of storing a
bookmark, closing the browser, starting a new browser and retrieving the
bookmark. This will not work in your application because you depend on
the session to remain the same.
 
The solution is to either NOT depend on the session for the audio data
retrieval, OR to include the session ID in the url itself. Which
solution you choose and how you wish to implement that solution is
entirely up to you. We'll be glad to help you regardless oft he
implementation you pick. Just don't expect your application to function
without modification, it is not Tomcat's nor the browser's fault that
it does not work, it is something you need to address in your web
application.
 
M.

 

But if I change to use IE6/IE7/IE8, this problem never happened.
Does someone know the reason? thanks.

 



This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.

If you have received this communication in error, please notify the sender 
immediately by telephone and with a 'reply' message.

Thank you for your co-operation.



Re: the Tomcat generates more than one session id with the same http request, please help me

2009-12-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mike,

On 12/8/2009 2:02 AM, Looijmans, Mike wrote:
 Seems like a propietary way of storing the session ID

Actually, it's well-defined by the servlet specification.

 -Original Message- From: Peter Chen
 But I don't know the part 
 getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD, is it
 also used to pass parameter?

Try:

String url = request.encodeURL(getParts.jsp[) + ? + [your params]

Then, just:

param name=filename value=%= url %

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksedu0ACgkQ9CaO5/Lv0PBkNwCdFcoX0yL4Kel9LLU8JWBNOUMh
bJAAn3TDk1ttFS2WnRY7KfN6T+eWeeh9
=Ump8
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-07 Thread Looijmans, Mike
Put the session ID in the URL and it will work on all systems.

Alternatively, don't use sessions for the audio file.
 

 -Original Message-
 From: Peter Chen [mailto:peter.c...@aicent.com] 
 Sent: maandag 07 december 2009 09:22
 To: users@tomcat.apache.org
 Subject: the Tomcat generates more than one session id with 
 the same http request, please help me
 
 Hi, all
 
  
 
 I am testing a website with the server Tomcat.  I am using 
 Tomcat 5.5.26, and I found one problem.
 
  
 
 The website is used to display audio files. After I log in 
 the website, I can see the icon of the audio file. But after 
 I press the button play, it has different results with 
 different browsers.
 
 When I use firefox3.5.5 and Google Chrome 3.0, I found the 
 Tomcat will create more than one session id, and it can not be played.
 
 But if I use IE6.0/IE7.0/IE8.0, I found there is only one 
 session id, and it plays well.
 
  
 
 I don't know the reason, has someone met this problem before, 
  please help me to solve this problem, thanks.
 
 

This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.

If you have received this communication in error, please notify the sender 
immediately by telephone and with a 'reply' message.

Thank you for your co-operation.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: the Tomcat generates more than one session id with the same http request, please help me

2009-12-07 Thread Pid

On 07/12/2009 08:22, Peter Chen wrote:

Hi, all



I am testing a website with the server Tomcat.  I am using Tomcat
5.5.26, and I found one problem.



The website is used to display audio files. After I log in the website,
I can see the icon of the audio file. But after I press the button
play, it has different results with different browsers.

When I use firefox3.5.5 and Google Chrome 3.0, I found the Tomcat will
create more than one session id, and it can not be played.


What bearing does the session have on this?
Are you storing data in it?


But if I use IE6.0/IE7.0/IE8.0, I found there is only one session id,
and it plays well.

I don't know the reason, has someone met this problem before,  please
help me to solve this problem, thanks.


Are you properly encoding all link URLs on each page with 
HttpServletResponse.encodeURL()?



p



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-07 Thread Peter Chen
Thanks for Mike's reply.

I searched on the Internet, and I got a method, the detail is as follows:
script language=JavaScript
document.write('object width=320 height=45 
classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95');
document.write('param name=filename 
value=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?timestamp=1260252638867contentid=137063timemark=20091110index=4
 /');
document.write('PARAM NAME=AUTOSTART value=false');
document.write('embed width=320 height=45 
type=application/x-mplayer2 
src=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?timestamp=1260252638867contentid=137063timemark=20091110index=4
 AutoStart=0');
document.write('/embed');
document.write('/object');
/script

The most important sentence is 
getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?timestamp=1260252638867contentid=137063timemark=20091110index=4

I know the URL like 
getParts.jsp?timestamp=1260252638867contentid=137063timemark=20091110index=4,
 this URL is used to pass parameters from one Jsp to another one. And we can 
get parameters with sentences like request.getParameter(timestamp); 
request.getParameter(contentid ).

But I don't know the part 
getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD, is it also used to 
pass parameter?

If so, how to get the parameter? Thanks.



-Original Message-
From: Looijmans, Mike [mailto:mike.looijm...@oce.com] 
Sent: 2009年12月7日 16:39
To: Tomcat Users List
Subject: RE: the Tomcat generates more than one session id with the same http 
request, please help me

Put the session ID in the URL and it will work on all systems.

Alternatively, don't use sessions for the audio file.
 

 -Original Message-
 From: Peter Chen [mailto:peter.c...@aicent.com] 
 Sent: maandag 07 december 2009 09:22
 To: users@tomcat.apache.org
 Subject: the Tomcat generates more than one session id with 
 the same http request, please help me
 
 Hi, all
 
  
 
 I am testing a website with the server Tomcat.  I am using 
 Tomcat 5.5.26, and I found one problem.
 
  
 
 The website is used to display audio files. After I log in 
 the website, I can see the icon of the audio file. But after 
 I press the button play, it has different results with 
 different browsers.
 
 When I use firefox3.5.5 and Google Chrome 3.0, I found the 
 Tomcat will create more than one session id, and it can not be played.
 
 But if I use IE6.0/IE7.0/IE8.0, I found there is only one 
 session id, and it plays well.
 
  
 
 I don't know the reason, has someone met this problem before, 
  please help me to solve this problem, thanks.
 
 

This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.

If you have received this communication in error, please notify the sender 
immediately by telephone and with a 'reply' message.

Thank you for your co-operation.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-07 Thread Peter Chen
Hi pid,

I used a JavaBean to pass the parameter, the sentence is like this:
jsp:useBean id=bean scope=session class=com.xxx.bean.MessageBean /
And the scope is session, in the Jsp page, I use this JavaBean like this:
Message msg = bean.getMessage();

And in the object of Message, I stored a MMS(Multimedia Message Service, 
include video and audio files), and I will get this MMS file later on.

But after testing, I found that, sometimes I executed the sentence Message msg 
= bean.getMessage();, and the variable msg return null.
But most time, it works well, and return a correct object.

Could you tell me the reason? Or is something I have done wrong?


-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: 2009年12月7日 18:21
To: users@tomcat.apache.org
Subject: Re: the Tomcat generates more than one session id with the same http 
request, please help me

On 07/12/2009 08:22, Peter Chen wrote:
 Hi, all



 I am testing a website with the server Tomcat.  I am using Tomcat
 5.5.26, and I found one problem.



 The website is used to display audio files. After I log in the website,
 I can see the icon of the audio file. But after I press the button
 play, it has different results with different browsers.

 When I use firefox3.5.5 and Google Chrome 3.0, I found the Tomcat will
 create more than one session id, and it can not be played.

What bearing does the session have on this?
Are you storing data in it?

 But if I use IE6.0/IE7.0/IE8.0, I found there is only one session id,
 and it plays well.

 I don't know the reason, has someone met this problem before,  please
 help me to solve this problem, thanks.

Are you properly encoding all link URLs on each page with 
HttpServletResponse.encodeURL()?


p



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: the Tomcat generates more than one session id with the same http request, please help me

2009-12-07 Thread Looijmans, Mike
Seems like a propietary way of storing the session ID, I'm not much into JSP 
stuff so I really don't know. Someone else here may be able to explain.

You can store whatever you need in parameters, either by putting into URLs or 
by creating (hidden) controls on web forms. This is the preferred method of 
parameter passing, as it allows multiple instances (e.g. browser tabs) to 
coexist. You should only store things in a session that are related to the 
connection and user (e.g. user credentials, preferences and such), but 
absolutely not the page he's navigating now.

You can also add a path to the URL, e.g.

getparts.jsp/137063/4

Then getPathInfo() will return 137063/4 in getparts.jsp.

M

 -Original Message-
 From: Peter Chen [mailto:peter.c...@aicent.com] 
 Sent: dinsdag 08 december 2009 07:49
 To: Tomcat Users List
 Subject: RE: the Tomcat generates more than one session id 
 with the same http request, please help me
 
 Thanks for Mike's reply.
 
 I searched on the Internet, and I got a method, the detail is 
 as follows:
 script language=JavaScript
 document.write('object width=320 height=45 
 classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95');
 document.write('param name=filename 
 value=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1A
 D?timestamp=1260252638867contentid=137063timemark=20091110i
 ndex=4 /');
 document.write('PARAM NAME=AUTOSTART value=false');
 document.write('embed width=320 height=45 
 type=application/x-mplayer2 
 src=getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?
 timestamp=1260252638867contentid=137063timemark=20091110ind
 ex=4 AutoStart=0');
 document.write('/embed');
 document.write('/object');
 /script
 
 The most important sentence is 
 getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD?time
 stamp=1260252638867contentid=137063timemark=20091110index=4
 
 I know the URL like 
 getParts.jsp?timestamp=1260252638867contentid=137063timemar
 k=20091110index=4, this URL is used to pass parameters from 
 one Jsp to another one. And we can get parameters with 
 sentences like request.getParameter(timestamp); 
 request.getParameter(contentid ).
 
 But I don't know the part 
 getParts.jsp;jsessionid=B01FF12CBC92F9BA1682E9A883A3A1AD, 
 is it also used to pass parameter?
 
 If so, how to get the parameter? Thanks.
 
 
 
 -Original Message-
 From: Looijmans, Mike [mailto:mike.looijm...@oce.com]
 Sent: 2009年12月7日 16:39
 To: Tomcat Users List
 Subject: RE: the Tomcat generates more than one session id 
 with the same http request, please help me
 
 Put the session ID in the URL and it will work on all systems.
 
 Alternatively, don't use sessions for the audio file.
  
 
  -Original Message-
  From: Peter Chen [mailto:peter.c...@aicent.com]
  Sent: maandag 07 december 2009 09:22
  To: users@tomcat.apache.org
  Subject: the Tomcat generates more than one session id with 
 the same 
  http request, please help me
  
  Hi, all
  
   
  
  I am testing a website with the server Tomcat.  I am using Tomcat 
  5.5.26, and I found one problem.
  
   
  
  The website is used to display audio files. After I log in the 
  website, I can see the icon of the audio file. But after I 
 press the 
  button play, it has different results with different browsers.
  
  When I use firefox3.5.5 and Google Chrome 3.0, I found the 
 Tomcat will 
  create more than one session id, and it can not be played.
  
  But if I use IE6.0/IE7.0/IE8.0, I found there is only one 
 session id, 
  and it plays well.
  
   
  
  I don't know the reason, has someone met this problem 
 before,  please 
  help me to solve this problem, thanks.
  
  
 
 This message and attachment(s) are intended solely for use by 
 the addressee and may contain information that is privileged, 
 confidential or otherwise exempt from disclosure under applicable law.
 
 If you are not the intended recipient or agent thereof 
 responsible for delivering this message to the intended 
 recipient, you are hereby notified that any dissemination, 
 distribution or copying of this communication is strictly prohibited.
 
 If you have received this communication in error, please 
 notify the sender immediately by telephone and with a 'reply' message.
 
 Thank you for your co-operation.
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

This message and attachment(s) are intended solely for use by the addressee and 
may contain information that is privileged, confidential or otherwise exempt 
from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for 
delivering