Stateless Spring MVC

前端 未结 2 1460
广开言路
广开言路 2021-01-06 12:20

Im currently reading Spring in Action 3rd edition, and have been experimenting with Spring MVC. Everything works well, until i tried to \'port\' my example webapp to a state

相关标签:
2条回答
  • 2021-01-06 12:55

    Make sure to have all the JSPs use

    <%@page session="false" %>
    

    else a session will be created as soon as a JSP is executed.

    0 讨论(0)
  • 2021-01-06 13:16

    Accidental session creation is one of the most common sources of invalid bug reports in Spring Security (hence the FAQ you linked to in your comment above).

    Spring Security's debugging filter can be useful if you're having issues with session creation. It will automatically log a message when a session is created, with a stacktrace inidicating where it happened. It also provides other useful information with more human-readable output that standard log entries, so is useful in a development environment. If you're using Spring Security's namespace support, you just need to add the element

    <debug />
    

    to your configuration.

    0 讨论(0)
提交回复
热议问题