aspose file tools*
The moose likes Servlets and the fly likes problems with form-based authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problems with form-based authentication" Watch "problems with form-based authentication" New topic
Author

problems with form-based authentication

Zhang Jones
Greenhorn

Joined: Feb 02, 2011
Posts: 17
ResourceServlet

web.xml

login.jsp

error.jsp

welcome.jsp


tomcat-users.xml

webpage
I'll very thankfull someone,who can help me to solve the problem!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

What problem ?

You shouldn't be accessing login.jsp directly. You should be accessing the /ResourceServlet via a POST. Only in this case will the login page be automatically shown.


[My Blog]
All roads lead to JavaRanch
Zhang Jones
Greenhorn

Joined: Feb 02, 2011
Posts: 17
Christophe Verré wrote:What problem ?

You shouldn't be accessing login.jsp directly. You should be accessing the /ResourceServlet via a POST. Only in this case will the login page be automatically shown.

It also doesn' work!
webpage
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Exactly what happens when you hit /resourceServlet.do

Try changing this part


To



Try changing http-method to GET as well.


[Servlet tutorial] [Servlet 3.0 Cook Book]
Pragya Patnaik
Greenhorn

Joined: Dec 03, 2009
Posts: 7
Even by changing the URL PATTERN it does not work...
As per my knowledge, whenever the welcome-file is called, it should redirect to login.jsp.
for e.g : my welcome file is index.jsp, and when called the base path, i get index.jsp without authentication...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Zhang Jones wrote:
It also doesn' work!
webpage

If you're typing that in your browser's url address, you'll send a GET request, not a POST.
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Try adding index.jsp to web-resource-collection, make sure you use GET method.
You can try constraining all URLS "/**" just to make sure your configuration works.

Once you know it works, you can change it to some thing like /private/* and have all your URLs that need authentication under this path.

And when pasting a link to your local machine, eg http://localhost in forum, don't use the URL bb code, because you don't want to make it clickable.
Zhang Jones
Greenhorn

Joined: Feb 02, 2011
Posts: 17
sudhir nim wrote:Exactly what happens when you hit /resourceServlet.do

Try changing this part


To



Try changing http-method to GET as well.


Thank you, but it doesn't work!
 
wood burning stoves
 
subject: problems with form-based authentication