Announcement Announcement Module
Collapse
No announcement yet.
DWR problem after timeout with Spring Security Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DWR problem after timeout with Spring Security

    Hi guys,

    I ran into a little issue while using DWR in a Spring web application. We've set a session timeout for X minutes. After the session is expired, the user is automatically redirected to the login page. In case a DWR call is attempted after the session expiry, the user is also redirected to the login page (which is good). But after he tries to login in, Spring will go to the last url before the expiry. In case this was a DWR call, the user receives a download popup to try downloading this DWR script call.
    Is there a way to redirect back to the page where the DWR call is made instead of the call it self?

    Thanks in advance.
    Davy

  • #2
    I found a solution for my problem described above. I replaced the redirect (after session expiry) from /login.htm to /logout.htm. In that way, Spring will clear everything from the session. This includes the URL of the last request after session expiry

    Comment


    • #3
      DWR call and session expired

      Hello,

      how can U achive that after session expiry in case a DWR call automatically redirected to the login page?

      Thanks
      Bye


      Originally posted by Krycek_A View Post
      Hi guys,

      I ran into a little issue while using DWR in a Spring web application. We've set a session timeout for X minutes. After the session is expired, the user is automatically redirected to the login page. In case a DWR call is attempted after the session expiry, the user is also redirected to the login page (which is good). But after he tries to login in, Spring will go to the last url before the expiry. In case this was a DWR call, the user receives a download popup to try downloading this DWR script call.
      Is there a way to redirect back to the page where the DWR call is made instead of the call it self?

      Thanks in advance.
      Davy

      Comment


      • #4
        Thanks Krycek_A for your hint.

        truszeka, please read "Coping with server session expiry" at directwebremoting.org web site ->Documentation ->Error Handling

        P.S. Since this is my first post a cannot post a url to this page.

        Comment


        • #5
          Thanks

          Thank You for your answer. But I've tried this "dwr.engine.setTextHtmlHandler" global function with no success. I use DWR 2.0.5.
          Maybe somthing other settings or things are incorrect.

          Bye, Bye

          Originally posted by CostasBal View Post
          Thanks Krycek_A for your hint.

          truszeka, please read "Coping with server session expiry" at directwebremoting.org web site ->Documentation ->Error Handling

          P.S. Since this is my first post a cannot post a url to this page.

          Comment


          • #6
            It seems to work fine for me. I use: DWR 2.0.5, Spring 2.5.3, Spring WebFlow 1.0.5, Tomcat 5.5.23 and Java 1.5.

            Comment


            • #7
              Bad news for me

              Originally posted by CostasBal View Post
              It seems to work fine for me. I use: DWR 2.0.5, Spring 2.5.3, Spring WebFlow 1.0.5, Tomcat 5.5.23 and Java 1.5.
              Hello,

              bad news for me, but I've tried all, no success. Now I implemented a JavaScript function witch count for the httpsession timeot time and after that redirect to the login page. This is all what I can do.
              Maybe can You give me some guidelines or tipps what to do ( or what not ).

              Bye, Bye

              Comment


              • #8
                Guys,

                Maybe this will sort some things out. Here is what I have done to solve my problem. In your page, add the following javascript code snippet in the head tag:

                Code:
                <script type="text/javascript">
                     /*
                      * Redirect to login page when a DWR request is send after a session timeout
                      */
                     try {
                         if (dwr && dwr.engine) {
                             dwr.engine.setTextHtmlHandler(function() {
                                 document.location = 'here goes the url to your login page';
                             });
                         }
                     catch(err) {} //ignore 
                </script>
                Make sure you also have the dwr libs on each page included

                If you make use of the SiteMesh decorator, you can place this code snippet in the decorator so you won't have to copy it on each page

                Comment


                • #9
                  Thanks, but I have the same code (without dwr exists check)

                  ;-(

                  But thank You very much. Have You logged that your code is called? ( with Firebug log.console or whatother )

                  Bye

                  Comment

                  Working...
                  X