Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keep getting Redirected to my Login Page

 
Dean Chester
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have written this filter for my application that redirects you to my login.jsp page if the user is not logged in. Yet all the restriced areas redirect me to the login page no matter here if the seesion is valid or not, then once logged in your are directed to the logged in home page. Here is the source for my filter:

Here is part of my web.xml file:

So if anyone can help i would be grateful
Thanks in advance
liZard12
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Can't see anything in that, can you post the login part that saves the user into the session?

Sean
 
Dean Chester
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you go:
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, nothing is jumping out.

Is the values that you are getting from the database definitely not null?
That's about the only thing I can think of.
 
Dean Chester
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean Clark wrote:Again, nothing is jumping out.

Is the values that you are getting from the database definitely not null?
That's about the only thing I can think of.


Your right the value is null i don't know why as it didn't display anything when i put something in the page that you get redirected to when you log in. Yet the username is set and printed out later in the code which gets it from the session.
 
Dean Chester
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry i made a mistake the attribute is getting set.
 
Dean Chester
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to everyone that has tried to help. I am now managing the sessions manually in a database and a cookie which works reasonably well just very slow on my testing set up but when deployed it works quicker as the database is local and not on the other side of the work.
Dean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic