| Author |
object dies when redirect=true
|
siddhu Math
Ranch Hand
Joined: Aug 10, 2006
Posts: 46
|
|
IN the whole project my role is very small but its not working help me folks my role is registared user logs in when he click on a link , this link redirect to my home page i have in corporated all the bussiness logic which is working fine but when i click on the log out button its not working since i am redirecting, my jsp page, where my home page become a part of the main page,(as object dies when redirected)hence how to make my logout button work. is there any way........... when i asked superiors they suggested me to close the whole window when i click the logout when i included the java script window.close code its also not working i do not know why.............
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
Not advanced Java; it's unclear whether the problem is Java-related at all. I'm going to move this to our JSP forum, just because it sounds like it might be an issue with understanding scoped data.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Divya Guttikonda
Ranch Hand
Joined: Mar 09, 2005
Posts: 47
|
|
|
A redirect, means the first page tells the browser to make a new request to the target page. Request scope objects are no longer available after a redirect because it is a new request. If you need to pass data to the page you are redirecting to, you have to use a query string and pass them as request parameters (or save the data as session or application scope objects).
|
 |
siddhu Math
Ranch Hand
Joined: Aug 10, 2006
Posts: 46
|
|
Firstly thanks for getting me a reply, but Divya Guttikonda since i am redirecting i will not be able to close or logout from the main window(from the page where it is redirecting to my page) even i am unable to close the iexplorer window(main window as well as sub window from my home page which is part of the main window).
|
 |
Richard Green
Ranch Hand
Joined: Aug 25, 2005
Posts: 536
|
|
|
You will not get a meaningful answer unless you post a meaningful question. Please rephrase your question - it does not any make sense to me.
|
MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
|
 |
siddhu Math
Ranch Hand
Joined: Aug 10, 2006
Posts: 46
|
|
Below is my code which i am using For logout <a href="javascript:window.close()" class="LikeButton">LOGOUT</a> But this is not working can any one tell me suggest me a way out of this........
|
 |
Richard Green
Ranch Hand
Joined: Aug 25, 2005
Posts: 536
|
|
how about you create a logoff page that does this:- <% session.invalidate(); response.sendRedirect(request.getContextPath()+"/index.jsp"); %>
|
 |
siddhu Math
Ranch Hand
Joined: Aug 10, 2006
Posts: 46
|
|
hay is there any code such that when logout is clicked that must directly invoke the "X" mark i.e close button which is in the top right corner of the Internet Explorer window.
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8142
|
|
is there any code such that when logout is clicked that must directly invoke the "X" mark i.e close button which is in the top right corner of the Internet Explorer window.
Why would you want to do that? My understanding of your problem is that you want to logout a user(i.e. invalidate the session) and direct him to a home page. If that's the case, then Lynette Dawson has already mentioned the code that will do this for you. Isn't this what you want?
|
[My Blog] [JavaRanch Journal]
|
 |
siddhu Math
Ranch Hand
Joined: Aug 10, 2006
Posts: 46
|
|
|
since i am redirected to a new home page hence i do no have the login object hence there is no question of invalidating login user session i have created a new session in which all my processes are carryed, hence that is the only option with me to directly close the internet explorer window which automatically invalidates all my sessions.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
Originally posted by siddhu Math: the only option with me to directly close the internet explorer window which automatically invalidates all my sessions.
You cannot close a window that you did not open, and closing windows will have no direct effects on the session.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Richard Green
Ranch Hand
Joined: Aug 25, 2005
Posts: 536
|
|
i have created a new session in which all my processes are carryed
if you created the session, then you should be able to clear it as well!
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: object dies when redirect=true
|
|
|