• Post Reply Bookmark Topic Watch Topic
  • New Topic

NetBeans Tomcat Jsp mysql forms login and session

 
Se Koan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a NetBeans web project on Tomcat 8.0.15, MySql (with Jconnector), Servlet/Jsp. I need a secure login!!!

There is a login page. On successful login, if it is admin, servlet redirects to the admin page, if username is of a standardUser, the servlet redirects to the main page.

For now nothing works. The page is not redirected by servlet, on submit button press the error.html appears and shows response.getStatus() is 0!!! I tested(without login) servlet for username/password check against the DB and it works.

so Here is my code files: login.jsp:

web.xml:

Context.xml:

Login.java:

Is context.xml - realm needed?
Why error.html appears and shows response.getStatus() is 0?
So, how to create a secure login?
How j_security_check connects to my MySql database!? - maybe that' the problem error page shows after login...?
 
Se Koan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In context.xml



web.xml


Copied mysql-connector-java-5.1.23-bin.jar into C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.15\lib

I also use <%= request.getContextPath() %> in order to connect resources to pages



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!