我在項目中配置了shiro以進行用戶名/密碼驗證。 'filters'和'urls'如下。刷新頁面導致重新登錄?
[filters]
authc.loginUrl = /login.jsp
shiro.loginUrl = /login.jsp
[urls]
/login.jsp = anon, authc
/index.jsp = authc
現在,只要當我們訪問的index.jsp,它會重定向到的login.jsp,即使我剛剛刷新的index.jsp。
當我刷新index.jsp時,如果緩存仍然知道該用戶已經登錄,如何才能讓它保持在index.jsp上?
順便說一句,我沒有配置緩存管理器,所以當它啓動時會彈出錯誤,如'org.apache.shiro.realm.AuthorizingRealm - 沒有設置緩存或cacheManager屬性。無法獲得授權緩存。'我應該如下配置(我只使用shiro核心& web)?
builtInCacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $builtInCacheManager