• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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.
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic