Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果由于用户键入需要身份验证的页面的 url 而显示登录页面,是否有办法从登录 jsp 页面获取“缓存”目标 url?我需要知道是否显示登录页面是因为用户直接键入了登录页面的url,或者是否显示登录页面是因为上一页需要身份验证。
谢谢。
Ok, here is how to do with Spring 3.x:
SavedRequest savedRequest = new HttpSessionRequestCache().getRequest(request, response)
which is null if there is no redirect, if not null, to get the url:
savedRequest.getRedirectUrl()