I have a login and a user info page which is displayed after login. How can I block user info page from direct access by user? How can I implement that with session?
相关问题
- #{facesContext} EL expression not resolved at runt
- jsp caching tag library
- JSP template implementation (Composite View Patter
- how to add a list of string into json object in js
- Two dimensional arraylist with c:foreach jstl tag
相关文章
- jsp里面的画布功能,为什么会出错?求大佬找下问题
- JSP String formatting Truncate
- Forward request from servlet to jsp
- Securing REST endpoint using spring security
- Comparing string and boolean in Expression languag
- Passing a Java object value in Custom JSP tag
- Passing a enum value as a tag attribute in JSP
- How to read authorization header in JAX-RS service
At login time, put the found
User
object in the session.Then implement a
Filter
which just checks the presence of the logged-in user in the session.Map this filter on an URL pattern of
/secured/*
(or anything else whatever you want) and put the secured pages like the user info page in the same folder.To logout a user, just do
session.removeAttribute("user")
or, more drastically,session.invalidate()
.