before-redirect="true" doesn't destroy conversation before redirect
lucas84 Jun 9, 2009 6:57 PMhi guys,
on first screen I have form with following button
`<s:button action="offers" value="#{messages['button.label.search']}" \>`
here is the page.xml for that page:
`<page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
<rewrite pattern="/" />
<navigation>
<rule if-outcome="offers">
<end-conversation before-redirect="true"/>
<redirect view-id="/offers/index.xhtml" />
</rule>
</navigation>
</page>`
I feel in, and submit the form (values are binded to conveersional component, but I don't promote to long running). So in my understanding between invoke application and issuing redirect, the conversation (temporary) context should be destroyed, so after redirect I get fresh context. In my case it doesn't work as I expect, cause after redirect I work on the same component. I created component as follows, just to double check if context isn't destroyed
`
@Name("conversationListener")
public class ConversationListener {
@Observer(value = "org.jboss.seam.preDestroyContext.Conversation", create = true)
public void onConversationPreDestroy() {
System.out.println("\n\n\n preDestroy \n\n\n");
}
@Observer(value = "org.jboss.seam.postDestroyContext.Conversation", create = true)
public void onConversationPostDestroy() {
System.out.println("\n\n\n postDestroy \n\n\n");
}
}
`
Between invoke application and redirect these observer methods aren't invoked.
The page.xml to page I am referring after redirection looks like follows:
`
<rewrite pattern="/offers/" />
<param name="phrase" value="#{quickSearch.searchPhrase}" />
<param name="location" value="#{searchActionDelegate.location}" />
<param name="range" value="#{searchActionDelegate.range}" />
<param name="model" value="#{advancedSearchAction.modelId}"/>
<begin-conversation join="true"/>
`
When I get redirected to that page I promote conversation to long-running. Does it affect, that the conversation before redirection isn't destroyed? Or anyway I should get fresh one.
I am working with seam 2.1.2.CR2
on first screen I have form with following button
`<s:button action="offers" value="#{messages['button.label.search']}" \>`
here is the page.xml for that page:
`<page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
<rewrite pattern="/" />
<navigation>
<rule if-outcome="offers">
<end-conversation before-redirect="true"/>
<redirect view-id="/offers/index.xhtml" />
</rule>
</navigation>
</page>`
I feel in, and submit the form (values are binded to conveersional component, but I don't promote to long running). So in my understanding between invoke application and issuing redirect, the conversation (temporary) context should be destroyed, so after redirect I get fresh context. In my case it doesn't work as I expect, cause after redirect I work on the same component. I created component as follows, just to double check if context isn't destroyed
`
@Name("conversationListener")
public class ConversationListener {
@Observer(value = "org.jboss.seam.preDestroyContext.Conversation", create = true)
public void onConversationPreDestroy() {
System.out.println("\n\n\n preDestroy \n\n\n");
}
@Observer(value = "org.jboss.seam.postDestroyContext.Conversation", create = true)
public void onConversationPostDestroy() {
System.out.println("\n\n\n postDestroy \n\n\n");
}
}
`
Between invoke application and redirect these observer methods aren't invoked.
The page.xml to page I am referring after redirection looks like follows:
`
<rewrite pattern="/offers/" />
<param name="phrase" value="#{quickSearch.searchPhrase}" />
<param name="location" value="#{searchActionDelegate.location}" />
<param name="range" value="#{searchActionDelegate.range}" />
<param name="model" value="#{advancedSearchAction.modelId}"/>
<begin-conversation join="true"/>
`
When I get redirected to that page I promote conversation to long-running. Does it affect, that the conversation before redirection isn't destroyed? Or anyway I should get fresh one.
I am working with seam 2.1.2.CR2