Java page re-direct

后端 未结 2 1761
悲哀的现实
悲哀的现实 2021-01-25 20:26

What I want to do is go to a disclaimer page when they first initially hit this method, and then any time after that go to a different page. My current method just takes to me

相关标签:
2条回答
  • 2021-01-25 21:23

    Create a session so you can track whether it's a users first "hitting the method", so you can chose to redirect him to the disclaimer or anywhere else.

    0 讨论(0)
  • 2021-01-25 21:28

    When the person hits the page for the first time, throw a flag on the session layer. Then anytime a person comes to the page you can check to see if it exists or not, and redirect them accordingly. Only problem with that is that they have to agree to it every time they visit unless you implement a login system.

    P.S. you should be able to get the Session off of the request object you get in that first line. Then just use setAttribute on that session object.

    0 讨论(0)
提交回复
热议问题