I am facing a problem in jsf web application deployed in jetty web-server. When access application in browser, jsessionID is appended in the url. I want to remove it from there. Thanks in advance.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Set the org.mortbay.jetty.servlet.SessionURL
parameter to none
in either the application web.xml or the context configuration.
See the Jetty jsessionId documentation.
回答2:
You can do that by Setting Session Characteristics. Set the context parameter org.eclipse.jetty.servlet.SessionIdPathParameterName
to none
to disable url rewriting and prevent the jsession id appended to URL.
In web.xml,
<context-param>
<param-name>org.eclipse.jetty.servlet.SessionIdPathParameterName</param-name>
<param-value>none</param-value>
</context-param>
Or if you are using annotation config instead of web.xml,
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
servletContext.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none");
}
Refer: Jetty's Session Management