This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Websphere and the fly likes Accessing HTTP session from business layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Websphere
Bookmark "Accessing HTTP session from business layer" Watch "Accessing HTTP session from business layer" New topic

Accessing HTTP session from business layer

surya sudhakar

Joined: Jun 11, 2002
Posts: 18
We have situation where we want to log the user information (id, name etc) in the log statements. In our current implementation we have a logging component (wrapper over Log4j) to log the debug statements both in presentation and business layers.

When the application is accessed concurrently all the log statements from different users are getting mixed up. We want to stamp the user details in the log statements, so that at later point of time we can get all the statements logged by a particular user. This way we think we can debug and track the user clicks in the browser.

Is there a way to get the user related information from the container instead of passing them to the logging component? Logging will be done in both presentation as well as business layer.

In presentation layer as we have access to the HttpREquest object we can get the user details from session very easily. But how can we get the information from business layer?

Is there any support at the WebSphere container level to store some information and later get it from different layers?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32481

No. You'll need to extract that information and pass it to your business layer.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Accessing HTTP session from business layer
It's not a secret anymore!