【发布时间】:2015-01-27 10:16:58
【问题描述】:
在我的 Spring(3.1) MVC Web 应用程序(servlet 3.0) 中,我在其中一个 JSP-s 中有以下 href 链接:
<a href="./edit_account?id=${account.accountId}">
<i class="icon-th-list"></i>${account.accountId} ${program.customer} </a>
它曾经在用户点击网页上的上述链接时正常工作,edit_account 用于附加到应用程序 url 并用于到达 Controller 类中的相应方法。
现在由于安全原因,我必须使所有 cookie 安全且仅限 http。因此在web.xml中添加了以下sn-p
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<session-config>
<cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
</session-config>
</web-app>
在上面添加之后,没有任何点击(所有 JSP-s 中的href)工作。
在网页上抛出以下错误,但 j_session_id 出现在 Url 上。
Http 400 description The request sent by the client was syntactically incorrect.
在我所有的 JSP 中,会话是 true。
有人可以帮我做些什么改变,即使在web.xml 中添加了上面的 sn-p 之后,所有流程也能正常工作?
【问题讨论】:
标签: java spring-mvc cookies spring-security servlet-3.0