File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java EE Security configuration not working.

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am trying to learn Java EE security. I configured security-constraint in web.xml file as
In glassfish server I have added 2 users in the file realms and also enabled "Default Principal To Role Mapping" option. But when I to tried to access any file under secure folder I could actually view it instead of being redirected to /public/login.jsp page.

Can anyone please explain me how to configure security in my web application.

Thank you all in advance. Good day.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you are doing a POST? Your security configuration has been configured for only the POST method and will not be applied for GET and other methods.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jai for pointing the problem. I am doing a redirection from index.jsp. I included GET and it is working now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic