aspose file tools*
The moose likes Java in General and the fly likes Urgent help Required!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Urgent help Required!!" Watch "Urgent help Required!!" New topic
Author

Urgent help Required!!

Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
Hi! ALL,
I've created a program to download files from internet. In this program I've used.........
java.net.Authenticator and java.net.PasswordAuthentication
package to authenticate the website. This was working fine when the site had small pop up window for Login but this logic is not working for the site which requires User to enter User Id and pass on the site itself and not in Pop up window. So tell me what to do in this situation.

SS
Sunny Liu
Ranch Hand

Joined: Mar 15, 2002
Posts: 63
java.net.Authenticator and java.net.PasswordAuthentication do not deal with HTML-FORM base anthentication, and there is no standard way how do peoples define their HTML username and password fields. If you are making a generic utility to do this job, it would be a pretty hard task. in your java code, you have to parse HTML page which has username and password field on it, to get input field name of these two field and Action URL then using HTTP POST in your URLConnection code to open connection.
for specific web site, you do not need to parse HTML page. you can find these information advance.
third way, You can develop a simple WEB browser to do this trick.


If I am rich, I will spend more.<p>IBM 486 (OOAD & UML) & 141 (XML) passed<br />Oracle 1Z0-007 passed<br />MCSD MCDBA MCSE <br />SCJP SCSSA<br />CCNA CNA A+
Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
Hi! Sunny,
Thanks for your reply. Yes after going through the details of java.net.Authenticator I came to know that it is not for HTML form.
I am creating application for specific URL. Could you please give me some help how to do it. It's really urgent. I want application to take username and pass automatically.
Thanks a lot ,
SS
Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
Hi! Sunny,
Just wanted to tell you I got the solution by using setRequestProperty()

SS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent help Required!!
 
Similar Threads
Check to see if "main page" is open or not from a pop-up?
popup windows for Html Forms
Pop-up blocker
javascript:window.close() not working in firefox
Pop-up window Issue