Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-5093

Seam produces malformed partial response on ViewExpiredException with Ajax

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.3.0.Final
    • Fix Version/s: 2.3.1.CR1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Seam 2.3.1-SNAPSHOT 2013-05-02 082f3b3459893b1c4200b7bd8ce99556f87f0dd0

    • Steps to Reproduce:
      Hide

      Follow the BackButtonTest procedure

      Steps to Reproduce:
      1. Build booking example and deploy on AS7/EAP6
      2. Navigate to http://localhost:8080/seam-booking/ and login as gavin:foobar
      3. Type anything into the Search field
      4. Click Logout
      5. Click browser's back button
      6. Click Find Hotels
      7. Notice that nothing happens

      Show
      Follow the BackButtonTest procedure Steps to Reproduce: 1. Build booking example and deploy on AS7/EAP6 2. Navigate to http://localhost:8080/seam-booking/ and login as gavin:foobar 3. Type anything into the Search field 4. Click Logout 5. Click browser's back button 6. Click Find Hotels 7. Notice that nothing happens
    • Bugzilla Update:
      Perform

      Description

      When ViewExpiredException occurs in an Ajax request, the response is malformed, containing duplicate partial-response element. This results in the response not being parsed (and in this case, redirect not being followed).

      <?xml version='1.0' encoding='UTF-8'?>
      <partial-response><redirect url="/seam-booking/home.seam?cid=22"></redirect></partial-response><?xml version="1.0" encoding="UTF-8"?>
      <partial-response><redirect url="/seam-booking/home.seam?cid=22"/></partial-response>
      

      This seems to happen, because there are two rules for the redirection in pages.xml:

      • main.xhtml has login required, handled in Pages.redirectToLoginView()
        <page view-id="/main.xhtml" login-required="true">
      • exception handler for ViewExpiredException, handled in ExceptionFilter
        <exception class="javax.faces.application.ViewExpiredException">
        <redirect view-id="/home.xhtml">
        ...
        </exception>

      None of the Seam's components involved (ExceptionFilter, Pages, Exceptions, RedirectHandler, MockExternalContext, ... ?) checks whether the response has already been written and the redirect partial response gets written twice.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  manaRH Marek Novotny
                  Reporter:
                  maschmid Marek Schmidt
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: