Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

401: Unauthorized xxx

 
Sagar kanchi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a project.
In this i am trying to access a website from which I have to download a file.
But while Iam trying to access the website thats giving the error as 401: Unauthorized xxx.
The website which I am trying to access is following BASIC authentication.
Already I have used PasswordAuthentication & Authenticator classes to break user name & password.
Do I need any special tags in my web.xml.
I wrote a normal web.xml as follows

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<servlet>
<servlet-name>CachingServ</servlet-name>
<servlet-class>CachingServ</servlet-class>

</servlet>
<servlet-mapping>
<servlet-name>CachingServ</servlet-name>
<url-pattern>/CachingServ/*</url-pattern>
</servlet-mapping>

</web-app>

Please can anybody suggest me in what way I can do that.

Its very very urgent please..........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic