Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

object dies when redirect=true

 
siddhu Math
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Divya Guttikonda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
siddhu Math
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about you create a logoff page that does this:-

<%
session.invalidate();
response.sendRedirect(request.getContextPath()+"/index.jsp");
%>
 
siddhu Math
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
siddhu Math
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic