Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Tomcat Form Authentication with JDBCRealm

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been struggling all night trying to get this to work and I can't tell if I am doing something wrong, or leaving something out, or what. Below is all my code, then I will say what is happening:
server.xml (relivant snippit)

web.xml (relivant snippit)

login.jsp

And my database has 2 tables
users
Username
Password
user_roles
Username
Role
---------------------------------------------------------
Now, I have a page in a folder called secure called AddReference.jsp. When I try and access this page, I do get redirected to login.jsp. I enter my username and password that I have stored in the database and after clicking submit, I am taken to my loginerror.jsp page. I should be redirected back to AddReference.jsp. I am entering the correct username and password as I only have one entry. I get no compilation errors or Tomcat errors when loading or stopping.
If anyone has some insight to my problem, I would be greatly appreciated.
If this needs to be moved to the JSP forum, please do so. I think it has more to do with the Tomcat config so that is why I posted it here.
Thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured out my problem. I was specifying the wrong user roles table in my realm element. typo mistake that took a whole day to find. Oh well, live and learn.
 
reply
    Bookmark Topic Watch Topic
  • New Topic