java - SpringMVC+Shiro implements jump problem after login
为情所困
为情所困 2017-05-27 17:40:03
0
3
948

The project uses SSM Shiro. If the login is successful, it will jump to the home page. It needs to know that the user has successfully logged in and display the user's information on the home page. How to do this.
The homepage is: index.jsp under Webcontent
SpringMVC configuration<url-pattern>/</url-pattern>
For example:
I visit https:/ /segmentfault.com, https://segmentfault.com is returned after successful login, but the user's information is loaded on the homepage.
I want to make the effect of changes before and after logging in to this site.


It seems that you can obtain the Subject in JSP and Java code to achieve this effect. Is there any better solution than this?

为情所困
为情所困

reply all(3)
世界只因有你

Either request the user information to be displayed on the page after the jump, or bring the user information when the jump occurs.
Also on the jsp page, shiro can use tags to directly obtain the user name, etc. You can take a look at this http://jinnianshilongnian.ite...

迷茫

1. After successful login, save it to the session, and then read the page
2. After successful login, return the login information, and then the page will display
3. Shiro tag reads the user login information and displays it
4. JSP custom tag, write and read in the background Get the logic and return to the front-end display
5. After successful login, save it to cookie, and the front-end reads the cookie and displays it

Ty80

You can put the information in during authentication, and then after logging in, jump to this page and get it directly.
-Supplement
In the controller, put it in the model and get it on the page

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template