• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Session Object in JSP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) How can we get a current session object in a JSP page other than using the method reequest.getSession?

2) Is config object available implicitly in a JSP page in all the versions of JSP?
 
Bartender
Posts: 3958
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sumit Sanghai:
1) How can we get a current session object in a JSP page other than using the method reequest.getSession?



The 'session' object.

An object of type javax.servlet.http.HttpSession.

This is the HttpSession object associated with the request. Sessions are created automatically, so this variable is bound even if there was no incoming session reference. The one exception is if you use the session attribute of the page directive to turn sessions off, in which case attempts to reference the session variable cause errors at the time the JSP page is translated into a servlet.

The session object created for the requesting client (if any). This variable is only valid for HTTP protocols. Has a session scope.



2) Is config object available implicitly in a JSP page in all the versions of JSP?



The 'config' object.

An object of type javax.servlet.ServletConfig.

The ServletConfig for this JSP page. Has a page scope.

The 'config' object exists both in JSP 1.2 and JSP 2.0.

More details : http://java.boot.by/wcd-guide/ch06s05.html

regards,
MZ
reply
    Bookmark Topic Watch Topic
  • New Topic