This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Authentication in a web application  RSS feed

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, posted this in another forum and am posting it here now. I am trying out form based authentication and data source realm. The application starts off with a page(logintest.jsp, outside the admin folder) that asks the user to click on a link to view the admin applications, the login page(login.jsp, located inside the admin folder.) appears after the link is clicked. The problem I have is that after typing in the correct username and password,I am expecting the index.jsp page from the "Admin" folder to be displayed, but instead I am seeing a directory listing for the admin foler. I am not sure what is wrong. The following are the contents from my context.xml and web.xml and also the app directory.

web.xml
-------


conetxt.xml
-----------


WebApp directory
----------------
<pre>
WebContent
- admin(folder)
index.jsp
login_error.jsp
login.jsp
- WEB-INF
web.xml
lgintest.jsp
</pre>

Hope someone can advise, thanks.



 
Marshal
Posts: 4465
284
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the code for the link look like?
 
John Paterson
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Cooke wrote:What does the code for the link look like?



Hi Tim Cooke,

This is the code for the form, I was expecting to be brought to the index.jsp page after filling and submitting this form, but instead I am getting to see the directory listing.
 
Saloon Keeper
Posts: 4754
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, index.jsp should be configured as welcome file, not logintest.jsp (assuming that the link goes to the "/" URL - does it?).

Also make sure to configure the server not to show directory listings.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!