You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thierry Cools <th...@s1.com> on 2001/01/10 09:20:04 UTC

Strange problem using Weblogic 6.0

Hi,

I've a strange problem using weblogic 6.0, when I start for the first time my browser (IE or Netscape), and after that start my application,
weblogic add the session id information in the adress bar, after that all my links are false. (Images & links to other pages)

e.g. http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/7002

becomes this after I clicked the anonymous login link.

http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/anonLogon.do

Note that this appears only the fisrt time.

Can anybody help me out ? Thanks in advance.

Thierry


Thierry Cools
 
Senior Java Developer 
S1 Brussels 
Kleine Kloosterstraat, 23 
1932 st. Stevens-Woluwe 
Belgium 
Tel : +32 2 200 43 82 
Email : thierry.cools@s1.com 


Re: Strange problem using Weblogic 6.0

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Thierry Cools wrote:

>  Hi Craig, Thanks for your explanations, but the problem is different, maybe I
> was not very clear in my first mail. The problem is that, as you can see in
> the adress link, Weblogic add '/' characters in the jsessionid and the servlet
> engine doesn't seems to be able to recognize that the session id is not a part
> of the context path, so that the context path contains the real context path +
> the session id, the result of this is that the application can not access all
> following links because of this. I hope it was more clear this time. Thanks
> for your help,Thierry
> Thierry Cools

This looks like a bug in the way WebLogic is doing URL rewriting.

The session id is required (by the servlet spec) to be passed as a *path*
parameter, not a *query* parameter.  According to the RFC for URL syntax (I
believe it's 2396, but don't have it available at the moment to check), the
overall syntax goes like this:

    scheme://host:port/resource-path;path-parameters?query-parameters

in other words, if I start with a URL like this:

    http://myhost/myapp/logon.do?name=value

I should end up with a URL like this:

    http://myhost/myapp/logon.do;jsessionid=12345?name=value

(which is what Tomcat and every other container I've tested does).  It looks to
me like Weblogic is sticking the session id before the "/logon.do" part, which
basically screws up the resource-path part of your URL.

Craig



Re: Strange problem using Weblogic 6.0

Posted by Thierry Cools <th...@s1.com>.
Hi Craig,

Thanks for your explanations, but the problem is different, maybe I was not very clear in my first mail.

The problem is that, as you can see in the adress link, Weblogic add '/' characters in the jsessionid and the servlet engine doesn't seems to be able to recognize that the session id is not a part of the context path, so that the context path contains the real context path + the session id, the result of this is that the application can not access all following links because of this.

I hope it was more clear this time. 

Thanks for your help,
Thierry

Thierry Cools
 
Senior Java Developer 
S1 Brussels 
Kleine Kloosterstraat, 23 
1932 st. Stevens-Woluwe 
Belgium 
Tel : +32 2 200 43 82 
Email : thierry.cools@s1.com 

  ----- Original Message ----- 
  From: Craig R. McClanahan 
  To: struts-user@jakarta.apache.org 
  Sent: Wednesday, January 10, 2001 6:39 PM
  Subject: Re: Strange problem using Weblogic 6.0


  Thierry Cools wrote: 
    Hi, I've a strange problem using weblogic 6.0, when I start for the first time my browser (IE or Netscape), and after that start my application,weblogic add the session id information in the adress bar, after that all my links are false. (Images & links to other pages) e.g. http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/7002 becomes this after I clicked the anonymous login link. http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/anonLogon.do Note that this appears only the fisrt time. Can anybody help me out ? Thanks in advance.  
    Thierry  
    Thierry Cools 
    Senior Java Developer 
    S1 Brussels 
    Kleine Kloosterstraat, 23 
    1932 st. Stevens-Woluwe 
    Belgium 
    Tel : +32 2 200 43 82 
    Email : thierry.cools@s1.com


  I'm not sure quite what you are asking about ... do you mean that the "jsessionid" entry disappears after the first link?  If so, that would be normal behavior if you have cookies enabled in your browser.  Tomcat does the same thing. 

  On the first transaction in a session, your servlet container has no idea whether or your client supports cookies or not, so it sends the session identifier both ways (as part of the URL, and as a cookie).  If the session id comes back in as a cookie, the container says "aha, this user supports cookies, so I don't need to do URL rewriting any more". 

  NOTE:  In order to support sessions without cookies, you must do URL rewriting around all hyperlinks you generate, using 

      response.encodeURL("path-to-a-page"); 

  Struts will do this for you in the <html:form> and <html:link> tags. 

  Craig McClanahan 
    


Re: Strange problem using Weblogic 6.0

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Thierry Cools wrote:

> Hi, I've a strange problem using weblogic 6.0, when I start for the first time
> my browser (IE or Netscape), and after that start my application,weblogic add
> the session id information in the adress bar, after that all my links are
> false. (Images & links to other pages) e.g.
> http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/7002 becomes
> this after I clicked the anonymous login
> link. http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=OlwYdOyUvn4izb1jzhih14cy8Vdz8fXakMh5dJN9LI2p5OpRzgYp|38225443033804101/-1408233741/7001/anonLogon.do Note
> that this appears only the fisrt time. Can anybody help me out ? Thanks in
> advance.
> Thierry
> Thierry Cools
>
> Senior Java Developer
> S1 Brussels
> Kleine Kloosterstraat, 23
> 1932 st. Stevens-Woluwe
> Belgium
> Tel : +32 2 200 43 82
> Email : thierry.cools@s1.com

I'm not sure quite what you are asking about ... do you mean that the
"jsessionid" entry disappears after the first link?  If so, that would be normal
behavior if you have cookies enabled in your browser.  Tomcat does the same
thing.

On the first transaction in a session, your servlet container has no idea
whether or your client supports cookies or not, so it sends the session
identifier both ways (as part of the URL, and as a cookie).  If the session id
comes back in as a cookie, the container says "aha, this user supports cookies,
so I don't need to do URL rewriting any more".

NOTE:  In order to support sessions without cookies, you must do URL rewriting
around all hyperlinks you generate, using

    response.encodeURL("path-to-a-page");

Struts will do this for you in the <html:form> and <html:link> tags.

Craig McClanahan