2014年5月15日星期四

Ask : back problem about the browser

jsp did not take long to learn just encountered a problem I would like to ask you about the great God .

himself made ​​a landing page login.jsp, submitted to the servlet named login database for authentication, log in to index.jsp correctly . The user is saved in the session bean .
In order to support the exit function on a label set up a home page , a link to the servlet named logout , logout by session.removeAttribute () after the user is removed , the request is forwarded to the login.jsp page,

removed after logout has been verified in the user session does not exist, then the request is forwarded to the login.jsp is not in session there will be no user?

In this case, click your browser's back button , or be able to return home the same index.jsp.
because in index.jsp outset verify whether a user 's session bean object , no words will be forwarded back to login.jsp.

Now get back index.jsp, then the user is not a bean object browser down to save the data in the form of landing resend it ?
Is there any way around this? Thank you !

------ Solution ------------------------------------ --------

If you click on a button or link to clear session , then return to the login page , session there is no user , but you point your browser's back button, just back a status page , do not jump to login.jsp
------ Solution ---------------------------- ----------------
you can index the page in the value of the output of the session and then you sign - exit -back- refresh to see the session values ​​are output Why go back a page personally think there should be no session of the country
remember seemingly jsp can write a disable browser caching stuff hey never done this experiment so that when you look for when you should go back is the need to initiate a request rather than a direct access to the browser cache it is now also commissioning a Sign of stuff back chrome can actually fill out a form before a dozen
------ Solution - -------------------------------------------

If you click on a button or link to clear session , then return to the login page , session there is no user , but you point your browser's back button , then just go back to the state of the previous page , and not jump to login.jsp          
  
  
I ask how can I make it back to be re- login authentication click on it ?   
I tried it buttoned space after exiting back to the landing page , but also be able to go back ,   
  
I tried Taobao, do not go back on the back , to continue to validate the user name password  
Click the back button and refresh the page will not go , but read the cached page , you want to refresh the page, where you can set jsp
<%
response.setHeader ("Cache-Control", "no-store");
response.setDateHeader ("Expires", 0);
response.setHeader ("Pragma", "no-cache");
%>
re- reading session, if the session is empty jumps login page , the landlord can try
------ Solution ----------------- ---------------------------
Token, you can try
------ For reference only - -------------------------------------
then ask how can I make have to click back Log in to verify it?
I tried it buttoned space after exiting back to the landing page , but also be able to go back ,

I tried Taobao, do not go back on the back , to continue to validate the user name password
------ For reference only ----------------- ----------------------
your screen back, if some ajax data back less than
----- - For reference only ---------------------------------------

If you click on a button or link to clear session , then return to the login page , session there is no user , but you point your browser's back button , then just go back to the state of the previous page , and not jump to login.jsp  


I ask how can I make it back to be re- login authentication click on it ?
I tried it buttoned space after exiting back to the landing page , but also be able to go back ,

I tried Taobao, do not go back on the back , to continue to validate the user name password
------ For reference only ----------------- ----------------------


no content ajax , I wrote to verify whether the landing is to see whether there is a basis for a User session bean object inside .
I thought the session bean object is removed on the line, but still be able to go back , indicating that the session bean does not completely remove the swap .

I do not know if this is not possible to control some of the properties through the browser js set ? Consult the
------ For reference only ------------------------------------ ---


This is the browser's reason?
------ For reference only -------------------------------------- -

and AB two users each string a mean
------ For reference only -------------------------- -------------


Click Exit is submitted to a servlet, session.removeAttribute () after printing user is null, but is able to back back index.jsp
maybe the second floor has a point , back to back is a state . But I try the browser cache , also thought .
I also used chrome
------ For reference only ----------------------------- ----------


So what good solution yet
------ For reference only -------------------------- -------------
Bangding , this problem has been bothering me , has not been Jing Xiaxin to study .
But even went back to return it no problem , because when you submit the form again, not a session user authentication it is not submitted by it do not go up that way .
------ For reference only -------------------------------------- -

If you click on a button or link to clear session , then return to the login page , session there is no user , but you point your browser's back button , then just go back to the state of the previous page , and will not Jump to login.jsp                
    
    
I ask how can I make it back to be re- login authentication click on it ?     
I tried it buttoned space after exiting back to the landing page , but also be able to go back ,     
    
I tried Taobao, do not go back on the back , to continue to validate the user name password          
Click the back button and refresh the page will not go , but read the cached page , you want to refresh the page, where you can set jsp   
<%   
response.setHeader ("Cache-Control", "no-store");   
response.setDateHeader ("Expires", 0);   
response.setHeader ("Pragma", "no-cache");   
%>   
re- reading session, if the session is empty jumps login page , the landlord can try  


Thank you, I try
------ For reference only ----------------------------- ----------
landlord but get requests ? If it is to post requests
------ For reference only -------------------------------- -------


a tag linked to the servlet seems that get put ?

没有评论:

发表评论