• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i get page session in jsp function

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
im trying to build generic function in jsp that will return the user session
but it seams i can't get it
is there any way to do it ?
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

function in JSP ? would you please elaborate and show us what have you done. Modern day JSPs are used only as view component and having routines , function , methods (whatever it may be) is a real killer of technology.
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i have function in java that i call from jsp ( old legacy code cant change it much )
now i have to send to this java function session data to support Authentication mechanization
i dont what to get the session befor each time i call the java fucntion , i was wandring if i can just
do it from one function center function
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The session is available as an implicit object in JSP pages; just pass the session, or the session attribute in question.

I'd recommend against passing the session directly, as that ties your back-end code to the servlet spec--something we should try to avoid.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:I'd recommend against passing the session directly, as that ties your back-end code to the servlet spec--something we should try to avoid.

Quoted for wisdom.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!