• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

NetBeans Tomcat Jsp mysql forms login and session

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



reply
    Bookmark Topic Watch Topic
  • New Topic