Skip to content

Tag: servlets

Variable returns null

In my project ,I need to pass the “price” value which is retrieved from the database in “Availability.java” to “display.jsp”.I have achieved it, but the problem is…. I also need to pass the “price” value from “display.jsp” to “seat.jsp&#8…

Should I use ThreadLocal to store connections?

I code my Test project and it is prohibited to use Spring and Hibernate there. I wanted to manage my transactions from Service layer. For this I have created a class that gets a Connection from the pool and puts it in the ThreadLocal. This is an example of the fields and the method. The class has also close, …

Log4j2 tomcat 10 memory leaks on shutdown

I have memory leaks at my tomcat 10.0.16 servlet application. I am using Log4j2 2.17.2 version, and after tomcat shutdown I see next logs: My pom.xml for Log4j2 is: And also log4j2 config Most common fix is to add log4j-jakarta-web, but this does not works for me Answer Fully deleting target folder and recomp…

Session created by Tomcat

I am learning session with servlets and i read in the book that to create a session we need to call as below. HttpSession session = request.getSession() This causes the web container to create a session ID and send it back to client so that client can attach it with every subsequent request to the server. Whe…