It's not a secret anymore!*
The moose likes JSP and the fly likes assign user name and password programmatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "assign user name and password programmatically" Watch "assign user name and password programmatically" New topic
Author

assign user name and password programmatically

Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi,
I have a folder (e.g., protected) in HTTP server. This folder contains PDF, HTML, and image files. This folder is password protected. So everytime when a user calls a file/page in this folder, it will pop up and a window asking user name and password.
Now, I have another page (e.g., test.jsp or test.html) containing links to the files in this protected folder. This page (test.jsp) is not in the protected folder. How can I program user name and password in ths test.jsp, so that users will not be asked for user name and password when they click a link to the files in the protected folder?


Thanks,<br />Mike
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

moving this to JSP. this is really a JSP question. you will have better results in that forum.


SCJP
Visit my download page
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
I am not sure why you would want to do this. If you are putting the username and password in the JSP you may as well not bother to have your folder protected?
Let me know if I am missing the point here...
S


<a href="http://www.samjdalton.com" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of [http://www.amazon.com/exec/obidos/tg/detail/-/1590592255/qid=1068633302//ref=sr_8_xs_ap_i0_xgl14/104-4904002-9274339?v=glance&s=books&n=507846]Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1861007701/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100561X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi Sam,
The reason is: the authentication system for the JSP page has already been implemented in the application server. We have a huge number of users, and I don't think it is good to make an anthentication file with all the user names and passwords in HTTP server.
Can you help, Sam?
Thank you agian for your time.
Mike
Dominic Paquette
Ranch Hand

Joined: Dec 13, 2002
Posts: 64
Hi,
When you say that they are password protected, do you mean you added a <security-constraint> tag to your web.xml file or is it someother way?
Dominic
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi Dominic,
I used the Basic authentication in HTTP server to protect a folder in HTTP server.
Dominic Paquette
Ranch Hand

Joined: Dec 13, 2002
Posts: 64
If a user clicks on a link on test.jsp, you don't want the login popup window to appear?
Dominic
Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hi Dominic,
Yes. Once a user has openned test.jsp and click a link, I want the file/page in the protected folder in HTTP server to display without asking the user to enter username and password.
 
wood burning stoves
 
subject: assign user name and password programmatically