I am developing one intranet application. i want to get the windows login username to log into my application.

because i want to check whether the same user is logging into the application or not.

i worked on using req.getRemoteUser() but it is returning null.

i am using the server is Tomcat6.x, Struts1.2

plz help me.

Srinivas.R

don't go to the see for a bath, if you have a perfect shower at home :)

you are making it way to hard on yourself.
all you need to use is the system properties, which you can find by
(either)
Properties props = System.getProperties();
or, for your problem:
String user = System.getProperty("user.name");

off course, there are these bozo's, who feel the need to (manually) change the username in their windows os, and then running app, just to bug the hell out of the developer. In case you would want possibilities as that to be covered as well, you might want to check out the JAAS Login Utility. never used it myself, so you might want to ask our good pal Google for some more explanation

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.