• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it safe to pass session object from jsp to a static method?

 
Makrand Ubale
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it safe to pass session object from jsp to a static method?
I am just getting an object from session in the static method.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as the static method uses/modifies only local variables there will be no conflict.

It would be easier to test the method if you could extract the variables first and pass them to the method call. Using the session means you can only test in a servlet environment.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!