• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

assign user name and password programmatically  RSS feed

 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
moving this to JSP. this is really a JSP question. you will have better results in that forum.
 
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mike Yu
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dominic,
I used the Basic authentication in HTTP server to protect a folder in HTTP server.
 
Dominic Paquette
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!