Hi,

You will have to handle the redirect on the client and not on the server 
when ajax is being used. Server should return some error_message or login 
page url back and the client should do something like this:

if(return_text == 'Login')
        document.location = <url to login page>

Hope this helps.
- rahul



From:
sharath karnati <karna...@yahoo.com>
To:
Struts Users Mailing List <user@struts.apache.org>
Date:
23-04-2010 20:20
Subject:
ajax method returning "login", how to do??



Hi All,
 
   Say I have ajax method, in this method first I'm checking whether user 
session is valid. If this user session is expired then returning "login", 
as per below lines it should display login.jsp page.
 
<global-results>
   <result name="login">/pages/login.jsp</result> 
</global-results>
 
 but it is returning login.jsp contents in ajax result NOT displaying 
login.jsp page. If session is not expired then this method is returning 
JSON object and it works fine.
 
  How to handle this scenario in struts2??
 
  Thanks in advance.
 
Regards,
Sharath.


 

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Reply via email to