如何在使用DOJO时检查会话何时到期 [英] How to check when session is expired while using DOJO

查看:81
本文介绍了如何在使用DOJO时检查会话何时到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我遇到了问题。我正在使用DOJO工具包在我的网页上获取一些数据。现在假设如果我离开我的网页一段时间并且会话过期然后我尝试点击调用DOJO(AJAX)调用的链接,它会尝试重新进行身份验证并建立一个会话。但是,然后它将身份验证JSP作为DOJO调用的结果而不是预期的JSP转发给我。请告诉我如何在DOJO调用中跟踪会话是否已过期。或者,如果您有任何解决此问题的方法。

注意:我使用以下

Java Struts / Dojo工具包

Hi All,

I am having a problem. I am using DOJO toolkits to fetch some data on my webpage. Now suppose if i leave my webpage for some time and the session gets expired and then i try to click on the link which invokes the DOJO(AJAX) call, it tries to re-authenticate and establish a session by itself. But, it then forwards me the authentication JSP as result of DOJO call instead of the intended JSP. PLease let me know how to track if the session has been expired in DOJO calls. Or if you have any solution for this problem.
Note: I using the following
Java Struts/ Dojo toolkit

推荐答案

只需检查是否返回了身份验证JSP,或者您可以使用另一个JSP文件,该文件根据会话是否已过期而返回true或false。
Just check if the authentication JSP is returned or you could use another JSP file which returns true or false depending on whether the session has expired or not.



只需检查是否返回了身份验证JSP,或者您可以使用另一个JSP文件,该文件返回true或false,具体取决于会话是否已过期。
Just check if the authentication JSP is returned or you could use another JSP file which returns true or false depending on whether the session has expired or not.



hi acoder,

实际上,在我的应用程序中,当会话过期并且您尝试命中服务器时,您首先进行自动验证。现在在我的情况下,应用程序的自动尝试验证它会返回jsp的代码,它在您登录应用程序后立即显示。它是一种jsp,表明你正在使用ssl连接,然后单击OK继续。

为了继续前进,我必须点击这个jsp上的ok按钮。我不知道该怎么做。我不想在我的页面上的任何div中显示这个jsp。此外,如果我刷新页面,我得到jsp,它具有我通常从ajax调用返回时使用的编码。这个jsp的代码会显示给我。

hi acoder,
Actually in my application whenever session gets expired and you try to hit the server, you are autometically authenticated first. Now in my case the application''s automatic attempt of authenticating it returns me the code of the jsp which gets displayed just after you login to the application. Its a kind of jsp showing that you are using ssl connection and click on OK to continue.
In order to proceed further i have to click on the ok button on this jsp. I dont know how to do it. I dont want to show this jsp in any div on my page. Moreover if i refresh the page i get the jsp which is having the coding which i utilise when normally return from ajax call. The code of this jsp gets displayed to me.


您可以在隐藏的iframe中显示该页面。然后访问iframe并使用按钮的click()方法。


OK按钮有什么作用?它是否提交表格?
You can display the page in a hidden iframe. Then access the iframe and use the button''s click() method.

What does the OK button do? Does it submit a form?


这篇关于如何在使用DOJO时检查会话何时到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆