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
15 13362 acoder 16,027
Recognized Expert Moderator MVP
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.
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,
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.
acoder 16,027
Recognized Expert Moderator MVP
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?
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?
Yes the OK buttton submits a form to an Action which creates the entitlements and lots of other things and forward it to the action which is handling my ajax call. That action forward to the jsp which is having some data which i am using in my original jsp
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
What I understood from your Question that is, you are trying to check whether session expired or not. And that is you are doing through a AJAX call. If AJAX call can successfully determine then it re-authenticates and establishes a new session. Right?
First let me know that. Then show me your code how much you did.
Debasis Jana
acoder 16,027
Recognized Expert Moderator MVP
Yes the OK buttton submits a form to an Action which creates the entitlements and lots of other things and forward it to the action which is handling my ajax call. That action forward to the jsp which is having some data which i am using in my original jsp
If it's a submit button, just make a request to the action page instead with all the POST parameters sent using the send() method.
If it's a submit button, just make a request to the action page instead with all the POST parameters sent using the send() method.
Hey buddy,
I am not suppose to touch the JSp behind that OK button
acoder 16,027
Recognized Expert Moderator MVP
Hey buddy,
I am not suppose to touch the JSp behind that OK button
Who said you have to change anything? Just look at what is posted and post that using Ajax. If that doesn't work, post your code from the beginning.
Hi All
I have a problem
I m using dojo to send a request.
But suppose my session has expired and i try to send request;it goes into infinite loop.
So will anyone telll me how to check whether session has expired or not?
I m using Dojo toolkit and jsp.
Thanx
acoder 16,027
Recognized Expert Moderator MVP
In your JSP code, you'll probably have some code which checks whether the user is logged in. If not, it will display the login page. So using that check, you can determine if the session has timed out or not.
If the session has timed out, return false, so in the response from the Ajax call, you can test for that.
Hi
Thnx for reply.
Actually in my application one filter is there which will check whether session is
expired or not.
If i make simple call it works fine but in case on ajax call it goes into infinite loop. - var bindArg = {
-
url:"xyz.action",
-
sync:true,
-
content:params,
-
load:function(type, data, evt) {
-
process(data);
-
}
-
};
-
dojo.io.bind(bindArg);
I have even tried to check status as well using evt.status.
but in case of session expired control doesn't go there
acoder 16,027
Recognized Expert Moderator MVP
When you say it works fine in the case of a simple call, what does it show/return?
You can't check the status property of the XMLHttp object because that's the status of the request.
In case of simple call if session has expired the control will goto login page but in case of ajax call it goes into infinite loop.
acoder 16,027
Recognized Expert Moderator MVP
You have two choices: either make a request to another page which simply returns true or false and check for that, or parse the response and look for login code. If it's there, then that means that the session has expired.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lenny |
last post by:
I have application that uses session variables to preserve
data between calls
Session expiration time is set to 20 min. Sometimes my
users getting error 'Session Expired' even right after
they...
|
by: szabelin |
last post by:
Hello - (1) is there a way to check that session has
expired? (2) My session timeout is set to 20 minutes, but
I can leave the client overnight and my session is still
on next morning- so when...
|
by: uni |
last post by:
Hi,
We are running asp.net application. Previously, there's no
any other problem, but recently, the session expired error
bumps out frequently like 10 minutes a time or so. The
session timeout...
|
by: Nathan |
last post by:
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).
The update...
|
by: net4matrimonials |
last post by:
I m using session veriables of asp.net on two websites
www.net4professionals.com(job site) and www.net4matrimonials.com
(bride/groom service)
when i create a session on page A i use codeing...
| |
by: NH |
last post by:
How can I warn a user that their session has expired when they click on a
button etc?
|
by: fijsolam1981 |
last post by:
Hi,
I had created a web application where Session expiry was set to 2,000
minutes in IIS. in web config i had given like this
<sessionState timeout="2,000" mode="InProc"></sessionStatebut MY web...
|
by: plsHelpMe |
last post by:
How to create dynamic javascript arrays using dojo toolkits
Hello frens,
I am in a big trouble. My objective is:
I am having some categories shown by differnent radio buttons, on the click of...
|
by: KalariaNitya |
last post by:
hi to all,
i have index.aspx form as main form..on that form one button GO which redirect to gallary.aspx form..
if i m doing nothing upto one or even less then one minute session goes expired...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |