What is the best way to do session and application initialization in a JSP page?

Prasad Thammineni

You can initialize the session and application using the HttpSession.putValue() and ServletContext.setAttribute() methods in a JSP page. The current HttpSession (session) and ServletContext (application) objects are made available implicitely to a JSP page as "session" and "application" objects.

As a best practise you should initialize these objects as part of post-processing in your JSP page or Servlet.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact