java - 当我将 cookie 名称更改为自定义时,Wicket 出现错误
问题描述
我将cookie名称更改为自定义名称。之后,当页面第一次加载时,Wicket 会出错。(出现意外错误(类型=未找到,状态=404))。当我重新加载页面时,没有错误,因为 cookie 已经创建。
春季启动配置
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");
尝试启动您的 Web 容器,-Dwicket.jsessionid.name=mySessionId
看看它是否有帮助。
推荐阅读
- multi-tenant - 没有数据同步代理的混合数据库同步
- php - 来自 php 的 SOAP 请求不起作用并给出错误:HTTP-Internal Server Error
- java - 获取此错误 java.lang.ClassNotFoundException: sun.swing.plaf.nimbus.NimbusLookAndFeel
- function - 为什么我的过程的参数出现“不是函数”错误?
- python - keras 后端设置
- django - 将 django 项目移至 Github 会删除其依赖包
- r - 将多个ggplot geom组合成一个图形
- django - 如何在 Django 的 HTML 模板中设置会话变量?
- c++-cli - 在 C++ Windows 窗体应用程序中使用“查询用户/服务器:XXX”命令
- scorm - 如何参考其他 LMS 的培训课程?