File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes DIfficult try!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "DIfficult try!!!" Watch "DIfficult try!!!" New topic
Author

DIfficult try!!!

vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
hi,
well im now trying to get the username and password from windows to my jsp page !!!To give u more details the jsp authentication page (eg.. login.jsp) should get the username automatically , if i open my login.jsp then the username should be present there !! anyone has some idea??


SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
This is usually accomplished by saving a cookie on the user's browser containing the login username. Look up the API for javax.servlet.http.Cookie and related entries in the HttpServletRequest and HttpServletResponse classes.
Bill
------------------
author of:
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
im gonna try this with a bean !!!
import java.lang.System;
public class Winuser {
String systprop;
public void getWinuser(String systprop){
systprop = System.getProperty("user.name");
}
}
well the code as such works but i have not yet implemented into my jsp page yet!!!
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi!
See How does the "j_security_check" work? in the J2EE EJB forum.


------------------
--
Pierre-Fran´┐Żois Lemosquet
Product team
E-Mail: pf.lemosquet@wokup.com
Wokup! Get your dotcom anywere...
http://www.wokup.com
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
The thing what im doing , is it wrong???
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
>>well im now trying to get the username and password from windows to my jsp page !!!
Windows System ???
I believe that it is possible with JAAS (PAM framework)
There is a native module nt.dll for Windows NT.
After install to see (for NT):
$install-dir/jaas1_0/jaasmod1_0-win/doc
Links http://java.sun.com/products/jaas/index-14.html

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DIfficult try!!!