【发布时间】:2015-09-18 23:13:56
【问题描述】:
我在使用 angularjs 的 apache shiro 和 spring mvc 时遇到了问题。
当我访问 angularjs 页面 http://localhost:8080/app 时出现 404 错误。在 app 文件夹内有一个 index.html,它应该是 angularjs 应用程序的开始。
下面是shiro.ini
# INI configuration is very powerful and flexible, while still remaining succinct.
# Please http://shiro.apache.org/configuration.html and
# http://shiro.apache.org/web.html for more.
[main]
authc.loginUrl = /login.html
authc.usernameParam = username
authc.passwordParam = password
authc.rememberMeParam = rememberMe
authc.successUrl = /app
logout.redirectUrl = /logout.html
# use in-memory caching to reduce the number of runtime lookups against the data source.
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager
# configure hashed password authentication
credentialsMatcher = org.apache.shiro.authc.credential.Sha512CredentialsMatcher
credentialsMatcher.storedCredentialsHexEncoded = false
credentialsMatcher.hashIterations = 1
# configure a realm to connect to the data source
daRealm = com.example.security.myRealm
daRealm.credentialsMatcher = $credentialsMatcher
securityManager.realms = $myRealm
[urls]
/app/** = anon
/favicon.ico = anon
/css/home.css = anon
/images/** = anon
/ = anon
/index.html = anon
/rest/** = anon
/logout = logout
/login.html = authc
/** = authc
【问题讨论】:
标签: angularjs spring spring-mvc shiro