Author: pete.muir(a)jboss.org
Date: 2010-02-21 07:10:00 -0500 (Sun, 21 Feb 2010)
New Revision: 5914
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ConversationPropagationFilter.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/jsp/JspTest.java
Log:
WELD-448
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ConversationPropagationFilter.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ConversationPropagationFilter.java 2010-02-21
12:02:20 UTC (rev 5913)
+++
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ConversationPropagationFilter.java 2010-02-21
12:10:00 UTC (rev 5914)
@@ -33,6 +33,8 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
+import org.jboss.weld.Container;
+import org.jboss.weld.context.ContextLifecycle;
import org.jboss.weld.conversation.ConversationImpl;
import org.jboss.weld.jsf.FacesUrlTransformer;
@@ -77,11 +79,14 @@
@Override
public void sendRedirect(String path) throws IOException
{
- ConversationImpl conversation = conversation(ctx);
- if (!conversation.isTransient())
+ if
(Container.instance().services().get(ContextLifecycle.class).isConversationActive())
{
- path = new FacesUrlTransformer(path,
FacesContext.getCurrentInstance()).toRedirectViewId().toActionUrl().appendConversationIdIfNecessary(conversation.getUnderlyingId()).encode();
- conversationManager(ctx).cleanupConversation();
+ ConversationImpl conversation = conversation(ctx);
+ if (!conversation.isTransient())
+ {
+ path = new FacesUrlTransformer(path,
FacesContext.getCurrentInstance()).toRedirectViewId().toActionUrl().appendConversationIdIfNecessary(conversation.getUnderlyingId()).encode();
+ conversationManager(ctx).cleanupConversation();
+ }
}
super.sendRedirect(path);
}
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/jsp/JspTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/jsp/JspTest.java 2010-02-21
12:02:20 UTC (rev 5913)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/jsp/JspTest.java 2010-02-21
12:10:00 UTC (rev 5914)
@@ -49,8 +49,8 @@
WebClient client = new WebClient();
client.setThrowExceptionOnFailingStatusCode(false);
Page page = client.getPage(getPath("/index.jsp"));
- assert page.getWebResponse().getStatusCode() == 300;
- System.out.println(page.getWebResponse().getRequestUrl());
+ assert page.getWebResponse().getStatusCode() == 200;
+ assert
page.getWebResponse().getRequestUrl().toString().contains("home.jsf");
}
@Override
Show replies by date