Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic question regarding predefined-variable: session  RSS feed

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to understand the difference between predefined-variable "session" with "request.getSession()".

I read the API and it says something like this for request.getSession():
"Returns the current session associated with this request, or if the request does not have a session, creates one."

I don't understand when I have to call request.getSession() and when I just need to use predefined-variable "session".

Thanks for the advice.
~ Rudy ~
 
Author and ninkuma
Marshal
Posts: 66727
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are one and the same.
 
Oh. Hi guys! Look at this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!