RT. I use jsp + servlet to write a simple Demo familiar with the filter effect. I write filter is used to determine the session log filtering, can be accessed if you have logged welcome.jsp page , otherwise returns login.jsp page . Without logging in direct address access filter effect. But in normal operation destroys the session after login , if the browser is still able to show hits the back welcome.jsp page . My understanding is that because the show is back operation cached page, which understand it right ? ? Then how can we click your browser's back after the operation so that the page reloads leaving the filter effect ? ?
------ Solution ---------------------------------------- ----
http://www.cnblogs.com/yuanyuan/archive/2010/01/12/1645297.html
------ Solution ---------- ----------------------------------
here, I tried it on my system click back button found page refreshes back to the login page does not appear you said the problem but I think the problem may be the existence of the page is a static page that I have no second request there are a lot of static requests to refresh the page when multiple requests filters to intercept these requests back to the login page also a
------ Solution -------- ------------------------------------
your filter is inside reads data from the session , As long as there is still valid in the session ( session start to finish ) , from which data can be read log
------ Solution ----------------- ---------------------------
off like the page cache
Search : Browser disable caching
------ Solution ------------------------------ --------------
that is read by the browser cache the page , you see some of the banking system back after the operation of any of the 404 directly . .
------ Solution ------------------------------------ --------
filter jump to a specific page and page block access to the browser's cache these two do not conflict it. .
Did not you say Log jump to a specific page and then click the "Back" button to display the top welcome.jsp here to add three lines of code plus disable cache it.
------ For reference only -------------------------------------- -
That is to say your filter to intercept actually being activated myself other requests ? I wrote Demo is very simple, no other static requests.
------ For reference only -------------------------------------- -
have to click on the operation that is carried out login session destruction operations. Then click your browser's back , it will show the previous pages , but in fact at this time of the session is null values , but if the page directly in the back to show a refresh operation , session will again have the original values. I have tested the console output .
------ For reference only -------------------------------------- -
Thank you for your reply , but I did not want to know.
------ For reference only -------------------------------------- -
you say is a separate set your browser ? There is no generic way , any browser can access the filter effect .
------ For reference only -------------------------------------- -
I jump to the corresponding page in the response header is set a few codes prohibit the page cache . Prevents access to the cache back . But this is not my first thought , as the filter effect is produced to jump to a specific page .
------ For reference only -------------------------------------- -
jsp page with this code but did not force me to jump in the servlet to welcome.jsp page, wrote in a response header Java code . With response.setHeader (...) ... manually set the prohibition cache.
------ For reference only -------------------------------------- -
The problem has been solved . The effect is not just to me previously thought .
没有评论:
发表评论