• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checking for bean in session

 
pendse anagha
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
I have a login Screen - and after Login I am storing a plain JavaBean on session .

In all the JSP pages - I want to show the name of the user logged in ( from the Java Bean on session )

For this I am using a common JSP
This is also used on the Login Screen

I want to first check - if the simple Java bean is on session

However - neither logic resent nor logic:empty seems to work

Any help would be greatly appreciated
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
logic resent should work. If you don't post what you are trying, no one can tell you what you are doing wrong.
 
pendse anagha
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes - I guess with out the code - its going to be difficult

Here is what I am trying :


Though the first time there is no bean on session - I enter the condition of Not null and I get the print :
" I SHOULD NOT BE HERE SINCE NO BEAN IS ON SESSION "

Thanks ,
-anagha
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that the notPresent tag needs the same attributes as the present one - it doesn't get them by magic.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't like specifying a test each time, look at JSTL's core library. c:choose allows something similar to if/else with when/otherwise:


[ March 11, 2005: Message edited by: Marc Peabody ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic