• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

configuration webapp with authentication

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to configuration a webapp. that runs under Tomcat with authentication via tomcat-user.xml file.
But my problem is that the browser popup window where I can type the username and the password in, does not appear.



Here is the web.xml


And here are some pices sever.xml
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see any url-patterns in your security-constraint tag that match your servlet's URL.

 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I add the the folowing line

into the web.xml.
But the login popup of the browser didn't appear.


The structur of my little webapp is:


so I think that the URL for my LoginServlet is allready matched by the line
<url-pattern>/com/foo/*</url-pattern>
of my web.xml file.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear "Curry Wurst",

I am one of the moderators of the JavaRanch forums. Here on JavaRanch, we have a naming policy. We want the users of JavaRanch to use a real-sounding name as their display name.

Unfortunately, your name "Curry Wurst" does not comply to the naming policy. Your display name should consist of a real-sounding first name, space, and a second name. Not only a first name, no obviously fake nickname, no initials only for the second name.

Please read the naming policy carefully and change your display name. You can change your name by editing your profile.

Please note that we are taking the naming policy seriously. If you do not change your display name, your account on JavaRanch might be locked.

Have fun on JavaRanch,
Jesper Young - Bartender
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I didn't read the naming policy. I changed my name to BalHug I hope this is Ok.
[ March 26, 2008: Message edited by: BalHug ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by BalHug:
Sorry I didn't read the naming policy. I changed my name to BalHug I hope this is Ok.


Unfortunately it's not. To quote from Jesper's post:

Your display name should consist of a real-sounding first name, space, and a second name. Not only a first name, no obviously fake nickname, no initials only for the second name.

So it's missing a space, and "Bal Hug" doesn't sound real to me, either (although that could just be ignorance on my part).
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I change it from BalHug to Hugo Balder I think now it's ok.
But this will not help me by my problem.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the URL that you're using when trying to log into your app?
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://localhost:8080/login/ for the entry of the webapp via index.html.
Here is the code of my index.html


and here is the code of the LoginServlet.java witch is under webapps/login/WEB-INF/classes/com/foo


BTW:
I am using Firefox under Windows XP
[ March 26, 2008: Message edited by: Hugo Balder ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not:

?
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo Ben,

thank you for your replay I still changed the web.xml to



I include your advice with the <url-pattern>/login/*</url-pattern> but nothing happens.

Here are some more information:
I use tomcat 6.0.14 under Windows XP and Firefox and IE as browser.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May we call you Egon?

If the name of your web app is "login" -and the URL you've posted suggests that it is-, then "login" should not be part of the URL patterns. Try "<url-pattern>/LogInServlet.do</url-pattern>" or, of course, "<url-pattern>/*</url-pattern>" if you want to protect everything.
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'ill take the strawberry ;-)

Ok, I protect everything with "<url-pattern>/*</url-pattern>" but the popup didn't appear.

So what do I wrong?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops.
I missed that 'login' was the actual name of the app.

Did you restart the app after making changes to your deployment descriptor?
 
Hugo Balder
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo Ben,

every time I changed the deployment descriptor, I restart Tomcat and Firefox.
 
reply
    Bookmark Topic Watch Topic
  • New Topic