• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

checking for bean in session

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic