Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session.setAttribute(Constants.USER_KEY, form); "Constants" not reolving

 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,


in the above code constant is not resolving, which class do i have to import for this,
and one more thing rather then setting user session attributes in this way can i set it in this way session.setAttribute("username", uid);
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bhavit pant wrote:hello ranchers,
in the above code constant is not resolving, which class do i have to import for this,


you have to create it yourself, or get it from wherever you got this example code.

bhavit pant wrote:
and one more thing rather then setting user session attributes in this way can i set it in this way session.setAttribute("username", uid);


Yes
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic