Bug 952571
| Summary: | Seam produces malformed partial response on ViewExpiredException with Ajax | ||
|---|---|---|---|
| Product: | [Retired] JBoss Enterprise WFK Platform 2 | Reporter: | Ron Šmeral <rsmeral> |
| Component: | Seam | Assignee: | Marek Novotny <mnovotny> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Marek Schmidt <maschmid> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 2.2.0 | CC: | amelicha, ppenicka, snagarwa, tremes |
| Target Milestone: | ER1 | ||
| Target Release: | 2.3.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
The partial-response elements in AJAX responses, produced by Seam, were duplicated. As a consequence, redirection rules defined in the pages.xml file were not processed correctly and therefore not followed. This has been fixed by placing a check in MockExternalContext to ensure that the response is not already committed when writing the partial response stanza. As a result, the duplication does not happen.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-07-16 11:32:35 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Ron Šmeral
2013-04-16 08:42:07 UTC
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. Doc text edited and inserted into the 2.2.0 release notes book. Docs stage URL: https://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Web_Framework_Kit/2.2/html-single/2.2.0_Release_Notes/index.html Build: JBoss_Web_Framework_Kit-2.2.0_Release_Notes-2.2-en-US-0-26 I forgot to emphasize this, but the issue occurs only when there are _multiple_ causes for the redirect. If _only_ the ViewExpiredException occurs, the response is OK, and the redirect works. The same for the login-required handler -- redirect works when it happens _alone_. Also I made a mistake -- it's the whole XML document that is duplicated in the HTTP response body, not just the partial-response element. Suggested ammendment to the RN text: "When there are multiple causes for a redirect in a single AJAX request, a malformed XML response is returned. Consequently, the affected redirection rules defined in pages.xml file are not correctly processed and therefore not followed. No workaround for this issue is currently known." Marek Novotny <mnovotny> made a comment on jira JBSEAM-5093 I don't know how to check already written partial-response in response output stream, so I clear the buffer with not committed content and let MockExternalContext.redirect(String url) to add the partial-response data. The tests - ErrorHandlingTest and ExceptionRedirectTest passes and booking demo behaves correctly again. I will commit the change and will try to launch functional tests to confirm it doesn't affect something else. Marek Novotny <mnovotny> updated the status of jira JBSEAM-5093 to Resolved Marek Novotny <mnovotny> made a comment on jira JBSEAM-5093 fixed by https://github.com/seam2/jboss-seam/commit/4c250daaa260bd7ccd9c1cf752a7d381b0e13315, if ftests doesn't pass I will reopen the issue again. wrong bz # in commit's comment references but it is fixed by https://source.jboss.org/changelog/Seam?cs=15494 Marek Novotny <mnovotny> updated the status of jira JBSEAM-5093 to Closed Marek Novotny <mnovotny> made a comment on jira JBSEAM-5093 2.3.1.CR1 is now out, so closing all resolved issues Verified on 2.3.0.ER1 release. Updated doc text. |