From: "Jim Douglas" <[EMAIL PROTECTED]>

I simply want to access an UserID from anywhere in an web-app.
JSP, method of any class file, servlet or otherwise...etc.
( Passing a string is what I ended up with.)

It sounds like you want a global variable like you might have in a procedural language. That would break encapsulation and go against "the rules" of object oriented programming.


In a JSP or a Servlet, you can get a reference to the session and retrieve the UserID (assuming you placed it as a session attribute.)

But it's not going to be visible to any method of any class, and IMO should not be. I think you've arrived at the correct solution-- pass the String into the method that needs it.

--
Wendy Smoak




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to