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 he doesn't ask for authenticate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "he doesn Watch "he doesn New topic
Author

he doesn't ask for authenticate

anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
this is my tomcat user.xml


this is a part of my web.xml


this is my servlet



i am using eclips IDE
when i am right click and run servlet runs and print hiiiii.
but why doesn't he ask for authenticate?
Teena George
Ranch Hand

Joined: May 01, 2008
Posts: 82

specify login-config also.
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
i add this to my web.xml

but still no change
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Anarkali.

Use the following code in web.xml and redeploy.

I think rolenames are case sesitive.
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
this is my web.xml now

it is not working still?
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
I think first time you have logged in. Delete active logins, cookies at the browser side and send request.
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
actually there is no logging page in my application.is it required?
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
ok.i delete the cookies.still same.anyway there is no login page is it required?
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Anarkali.
No need to use login page since, authentication method is BASIC. Browser's login window will ask for username and password.
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

What is the URL that you are entering in the browser?? You've configured the URL as which means that you'll have to enter this URL in your browser http://localhost:8080/contextPath/New/ShowHeadersServlet/ , then the browser should ask for username and password...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
i change the web.xml as follows


and then i use this url
http://localhost:8080/chapter1/HelloWorldServlet
then it is working?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: he doesn't ask for authenticate
 
Similar Threads
security constraint - not working
Authentication in web-app Security
Basic Authentication Does Not Work Properly
BASIC Authentication using memory realm with apache-tomcat5.5 & servlet
HTTP Status 403 Access to the requested resource has been denied