Sarra Sakka wrote:Without a filter, how can i create a session when i loged in and how can i invalidate it when i loged out ?
thank you for you effort
Sarra Sakka wrote:
John Schretz wrote:
So in places where you would forward or redirect you would use url pattern you mapped in for that servlet
i.e.
view plainprint?
Note: Text content in the code blocks is automatically word-wrapped
getRequestDispatcher("test/home").forward(req, res);
when i log in the home page didn't display
Sarra Sakka wrote:
John Schretz wrote:
if you put a breakpoint in the filter when you refresh the page at that point does it hit the breakpoint?
No, when i refresh the page it doesn't hit the breakpoint, that's mean there's a problem in the filter?
Sarra Sakka wrote:
John Schretz wrote:
after you click back and it displays the home page, what happens if you then refresh the page? Does it go to the login page then?
No, it don't go to the login page and remains in the same page home.jsp
Sarra Sakka wrote:The same problem
when i click a back button it display a home.jsp
Sarra Sakka wrote:thank you for your reply,
John Schretz wrote: You only need the filter for checking the valid user.
do you mean only like this :
Sarra Sakka wrote:
John Schretz wrote:In addition there is some bad logic and coding practice in your authentication servlet. I can go mre complex but here is you servlet refactored, please see comments:
I change my authentication servlet like as you say, also my Logout servlet, but always the same problem occurred ?
here's the filter :
Sarra Sakka wrote:Always the button back display the home page
here's the filter :
what's the problem according to you ?
I'm stuck
Sarra Sakka wrote:If i use setAttribute in my login servlet, what shoul i put in my logout servlet