• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

he doesn't ask for authenticate

 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

specify login-config also.
 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i add this to my web.xml

but still no change
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Anarkali.

Use the following code in web.xml and redeploy.

I think rolenames are case sesitive.
 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my web.xml now

it is not working still?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think first time you have logged in. Delete active logins, cookies at the browser side and send request.
 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually there is no logging page in my application.is it required?
 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.i delete the cookies.still same.anyway there is no login page is it required?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
anarkali perera
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i change the web.xml as follows


and then i use this url
http://localhost:8080/chapter1/HelloWorldServlet
then it is working?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic