You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by joatom <jo...@joatom.de> on 2007/02/18 15:27:03 UTC

Another myFaces - servlet redirect issue.

Hi,

I've written a NonFacesRequestServlet which works almost fine:


public class MyServlet extends NonFacesRequestServlet{
  public String invokeApplication(FacesContext fc){
    ...
    return "page/viewer/details.jsp";
  }
} 

  <servlet-mapping>
    <servlet-name>PromoDetailServlet</servlet-name>
    <url-pattern>/faces/detail.jsp/</url-pattern> 
  </servlet-mapping>

  <navigation-rule>
	<navigation-case>
		<from-outcome>page/viewer/details</from-outcome>
		<to-view-id>/page/viewer/details.jsp</to-view-id>
	</navigation-case>
  </navigation-rule>



So, after invoking the Servlet the navigation rule brings me to details.jsp
view and the browser shows the URL: "..faces/detail.jsp?entry_id=1234". 
Unfortunatily, I cannot make any  page-reloading (<tc:tab
switchType="reloadPage"..>) on the "details.jsp" page because it'll lead to
the URL: "../faces/detail.jsp/page/viewer/details.jsp".
I tried out a <redirect/> in the navigation rule to to come out at
"../faces/page/viewer/details.jsp" instead of "../faces/detail.jsp". But it
didn't work.

I would be pleased by any suggestions on that one?

btw: keep up the gorgeous work on tobago ;-)

-- 
View this message in context: http://www.nabble.com/Re%3A-myFaces---servlet-redirect.-tf936557.html#a9029978
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: [Solved] Another myFaces - servlet redirect issue.

Posted by joatom <jo...@joatom.de>.
I figured it out, allthough it seems to be more like a work-around rather
then a nice solution.
Anyway,

I made a new file 'servlet_redirect.jsp' only including:

<%response.sendRedirect("http://localhost:8080/faces/page/viewer/details.jsp");
%>


Besides, I changed the config to

 <navigation-rule>
        <navigation-case>
                <from-outcome>page/viewer/details</from-outcome>
                <to-view-id>/page/viewer/servlet_redirect.jsp</to-view-id>
        </navigation-case>
  </navigation-rule> 

Done! Everything works just fine even backnavigation.

cya,

Johannes
-- 
View this message in context: http://www.nabble.com/Re%3A-myFaces---servlet-redirect.-tf936557.html#a9126751
Sent from the MyFaces - Users mailing list archive at Nabble.com.