resin3.0.18有关jsessionid的问题

虚拟空间最近升级为resin3.0.18,本站出现只要在url中出现了jsessionid的情况均不能访问,初步估计是虚拟空间的设置可能屏蔽了这种url的访问。

但是,我们使用了struts的标签库,我目前发现无法避免不在url中出现jsessionid(在一次的连续访问中,这种带jsessionid的url出现一次后面的访问就不出现了)。

查了一下,resin中有关session的设置有下面这么一项可能有用,但是,目前网站移回原来的resin2,到时,空间不提供resin2的时候可以一试。

来自http://www.caucho.com/resin-3.0/config/webapp.xtp

By default, both enable-cookies and enable-url-rewriting are true. To force url rewriting, you would create a configuration like:

<web-app id='/'>

  <session-config

   enable-cookies='false'

   enable-url-rewriting='true'/>

</web-app>

这样,如果空间不能执行带jsessionid的url时,我可以试着把enable-cookies='true',而把enable-url-rewriting='false',这样url中就不会出现jsessionid了,程序通过用户的cookie来保持session。只不过要求用户必须开启cookie了。

另外,有关resin服务器的设置中关于session的部分:http://www.caucho.com/resin-3.0/config/resin.xtp


Attribute Meaning default

alternate-session-url-prefix  a prefix to add the session to the beginning of the URL as a path prefix instead of the standard ;jsessionid= suffix. For clients like mobile devices with limited memory, this will allow careful web designers to minimize the page size.  null 

keepalive-max  the maximum number of keepalive connections  512 

keepalive-timeout  the maximum time a connection is maintained in the keepalive state  120s 

alternate-session-url-prefix  <server>

  ...

  <alternate-session-url-prefix>/~J=</alternate-session-url-prefix>

  ...