当我将 cookie 名称更改为自定义时,Wicket 出错
Wicket gives an error when I changed cookie name to custom
我将 cookie 名称更改为自定义名称。之后,Wicket 在页面第一次加载时给出错误。 (出现意外错误(类型=未找到,状态=404))。当我重新加载页面时,没有错误,因为已经创建了 cookie。
Spring 启动配置
server.session.cookie.name=mySessionId
来自org.apache.wicket.util.string.Strings.java
:
/**
* The name of the parameter used to keep the session id.
* The Servlet specification mandates <em>jsessionid</em> but the web containers
* provide ways to set a custom one, e.g. <em>sid</em>.
* Since Wicket doesn't have access to the web container internals the name should be set explicitly.
*/
public static final String SESSION_ID_PARAM_NAME =
System.getProperty("wicket.jsessionid.name", "jsessionid");
尝试使用 -Dwicket.jsessionid.name=mySessionId
启动您的 Web 容器,看看是否有帮助。
我将 cookie 名称更改为自定义名称。之后,Wicket 在页面第一次加载时给出错误。 (出现意外错误(类型=未找到,状态=404))。当我重新加载页面时,没有错误,因为已经创建了 cookie。
Spring 启动配置
server.session.cookie.name=mySessionId
来自org.apache.wicket.util.string.Strings.java
:
/**
* The name of the parameter used to keep the session id.
* The Servlet specification mandates <em>jsessionid</em> but the web containers
* provide ways to set a custom one, e.g. <em>sid</em>.
* Since Wicket doesn't have access to the web container internals the name should be set explicitly.
*/
public static final String SESSION_ID_PARAM_NAME =
System.getProperty("wicket.jsessionid.name", "jsessionid");
尝试使用 -Dwicket.jsessionid.name=mySessionId
启动您的 Web 容器,看看是否有帮助。