aspose file tools*
The moose likes Tomcat and the fly likes configuration webapp with authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "configuration webapp with authentication" Watch "configuration webapp with authentication" New topic
Author

configuration webapp with authentication

Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't see any url-patterns in your security-constraint tag that match your servlet's URL.



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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 ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
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).


Ping & DNS - my free Android networking tools app
Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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

Joined: Dec 11, 2004
Posts: 13410

What is the URL that you're using when trying to log into your app?
Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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

Joined: Dec 11, 2004
Posts: 13410

Why not:

?
Hugo Balder
Greenhorn

Joined: Dec 14, 2001
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
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

Joined: Dec 14, 2001
Posts: 9
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 14, 2001
Posts: 9
Hallo Ben,

every time I changed the deployment descriptor, I restart Tomcat and Firefox.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configuration webapp with authentication