简体   繁体   中英

how to stop jsp from creating sessions on page load

I know that JSP will create sessions automatically on page load. In my login page I don't want it to create sessions util i click on submit button, and also if user login fails I am sending error message in session so that time it should accept the session already created and after showing error message session should be invalidated. How can i achieve this.

I have tried session = false in JSP, this is showing error where i am getting previous session to show error message.

I have also tried page hit count using application.setAttribute but this is showing illegalStateException on first load itself.

Any ideas ?

这避免了会话创建

<%@ page session="false" %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM