You could also do this by invoking the Faces NavigationHandler with query-parameters ?faces-redirect=true<br><br>And additional values that were passed. I think that would be the most stable for JSF, but if you also want it to handle servlets, then maybe what you are suggesting is better, just skipping JSF.<br>
<br><div class="gmail_quote">On Mon, Aug 15, 2011 at 1:25 PM, Brian Leathem <span dir="ltr">&lt;<a href="mailto:bleathem@gmail.com">bleathem@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 11-08-12 06:50 PM, Cody Lerum wrote:<br>
&gt; I have a particular use case where I need to:<br>
&gt;<br>
&gt; 1. End the current conversation if it exists<br>
&gt; 2. Redirect to a specific view-id<br>
&gt; 3. Optionally pass along some parameters.<br>
&gt;<br>
&gt; This led me to create new RedirectHelper for Seam Faces that allows me<br>
&gt; to do something like this.<br>
&gt;<br>
&gt; redirectHelper.viewId(&quot;/admin/user.xhtml&quot;).param(&quot;oid&quot;,100).endConversation().redirect();<br>
&gt;<br>
&gt; After doing so George Gastaldi and I found that this was partially<br>
&gt; available in Seam Servlet through RedirectBuilder and can accomplish<br>
&gt; the same like this.<br>
&gt;<br>
&gt; redirectBuilder.redirect(request.get().getContextPath() +<br>
&gt; &quot;/admin/user.xhtml&quot;).param(&quot;oid&quot;, 100).send();<br>
&gt;<br>
&gt; The only hang-ups being that it doesn&#39;t have support conversation<br>
&gt; control (yet) and also assumes that if I have a &quot;/&quot; at the start of my<br>
&gt; view-id that it is absolute and not to include the ContextPath. In<br>
&gt; faces however I expect that the ContextPath will be added<br>
&gt; (&quot;localhost:8080/myApp/admin/home.xhtml&quot;). IMHO RedirectBuilder just<br>
&gt; seems like it would be a little rougher to a new faces user too.<br>
<br>
</div>In addition, you don&#39;t know what the Faces Servlet mapping is, so you<br>
could have to deal with arbitrary prefixes and extensions at the URL level.<br>
<div class="im"><br>
&gt; Does it make sense to alter the Seam Servlet RedirectBuilder to handle<br>
&gt; these additional functions, or should I keep RedirectHelper in Faces<br>
&gt; and have it be a softer way for users to work when redirecting within<br>
&gt; JSF? I can utilize RedirectBuilder to handle the actual redirect in<br>
&gt; the impl.<br>
<br>
</div>I&#39;d suggest building something in Faces that builds on top of what is in<br>
Seam Servlet.  Map the viewId to the URL using the facesContext, then<br>
delegate the rest of the url building to the Servlet RedirectBuilder.<br>
<br>
Thanks for contributing this helper code back into the project!<br>
<font color="#888888"><br>
Brian<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>