开发者

JSESSIONID added to URL when Weblogic redirects to Apache?

开发者 https://www.devze.com 2023-04-04 23:13 出处:网络
Our application is running on WebLogic. At some point the WebLogic is redirecting to Apache to allow the user to access PDF files.

Our application is running on WebLogic.

At some point the WebLogic is redirecting to Apache to allow the user to access PDF files.

This happens via:

final String encodedURL = resp.encodeRedirectURL(redirectURL);                
resp.sendRedirect(encodedURL); //ok here because redirection to other  server and not  to itself

The problem is that WebLogic appends a JSESSIONIDto the URL and the apache fails to serve the PDF Document.

How can I prevent Web开发者_StackOverflow社区Logic from adding the JSESSIONID to the URL?


The whole point en encodeRedirectURL is to include the session ID in the URL if necessary. f you think it's not necessary to include it, don't encode the URL:

resp.sendRedirect(redirectURL);


the problem was, that in our weblogic.xml cookies were disabled:

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<session-descriptor>
    <cookies-enabled>false</cookies-enabled>
</session-descriptor>

whe solved the issue by setting them to true. in this special application, this was not a problem:

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<session-descriptor>
    <cookies-enabled>true</cookies-enabled>
</session-descriptor>


Adding this to my Facelets based application's web.xml avoids JSESSIONID:

<session-config>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号