Author: manaRH
Date: 2013-05-10 09:23:34 -0400 (Fri, 10 May 2013)
New Revision: 15494
Modified:
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/MockExternalContext.java
Log:
bz921660 tried to fix duplicated ajax partial-response for redirection
Modified:
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/MockExternalContext.java
===================================================================
---
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/MockExternalContext.java 2013-05-10
13:23:22 UTC (rev 15493)
+++
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/MockExternalContext.java 2013-05-10
13:23:34 UTC (rev 15494)
@@ -544,8 +544,10 @@
@Override
public void redirect(String url) throws IOException
{
- if
("partial/ajax".equals(this.request.getHeader("Faces-Request")))
+ if
("partial/ajax".equals(this.request.getHeader("Faces-Request"))
&&
+ !this.response.isCommitted())
{
+ this.response.reset(); //reset any data to not duplicate any response
this.response.setContentType("text/xml");
this.response.setCharacterEncoding("UTF-8");
this.response.addHeader("Cache-Control", "no-cache");
@@ -558,7 +560,7 @@
this.response.getWriter().flush();
}
else
- {
+ {
this.response.sendRedirect(url);
}
Show replies by date