• Post Reply Bookmark Topic Watch Topic
  • New Topic

logging page

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP application I need a way to log when and by whom this application was accessed (based on user id). This application works by sumbitting data to iteslf, so I don't want entry to be written to a log file every time application is used, but only when it's being accessed for the first time. How can I do this with session object?

thanks,
Alex
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could probably use the isNew() method on HTTPSession to meet your needs.

Jules
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, but if user logged in and used other applications before mine, when he enters my application session is no longer new.
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ August 20, 2004: Message edited by: Rovas Kram ]
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I might have left out one detail. This application that needs logging can be loaded with different parameters and thus can load different data. So if I load application with one parameter logging works, but then if I load same application with different parameter logging does not work -- it's in the same session.
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry but I don't understand your requirement especially since your last statement doesn't seem to relate to your first.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex,

An HTTPSession only exists in the context of a single web application (ServletContext). What do you mean by "another application"?

My suggestion would work, as would Rovas's (though it's implementing the same thing manually).

Please explain what you mean by an application here as you seem to be describing something other than a web application.

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