Forums Register Login

Why isn't redirct working?

+Pie Number of slices to send: Send
Hi,

I am trying to set up a redirct in my faces-config.xml file but it's not redirecting and I can't figure out why. I have these files ..

/myapp/jsp/AddApplication.jsp
/myapp/WEB-INF/classes/com/comcast/npsconfig/jsf/controllers/AddApplicationPage.class

and within AddApplication.jsp I have

<h:form id="appEditForm" target="_top">
...
</h:form>

Here are the relevant definitions in my faces-config.xml file:

<managed-bean>
<managed-bean-name>AddApplicationPage</managed-bean-name>
<managed-bean-class>com.comcast.npsconfig.jsf.controllers.AddApplicationPage</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>jsp/AddApplication</display-name>
<from-view-id>/jsp/AddApplication.jsf</from-view-id>
<navigation-case>
<from-action>#{AddApplicationPage.saveApplication}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/jsp/main.jsf#addApp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>


Any ideas why I'm not being redirected to "main.jsf"? I've confirmed that the bean is outputting a "success" message. - Dave
+Pie Number of slices to send: Send
Dane I think that the problem is that the file /jsp/main.jsf doesn't exist what you need to reference is /jsp/main.jsp, also /jsp/AddApplication.jsf should be /jsp/AddApplication.jsp if your pages are jsp otherwise there should be your real file extension and not the mapping. For what are you using #addApp??
[ July 24, 2008: Message edited by: Andres Quinones ]
+Pie Number of slices to send: Send
Thanks for this. All this JSF/JSP extension stuff is definitely confusing. I tried this new navigation rule, but it still doesn't redirect:

<navigation-rule>
<display-name>jsp/AddApplication</display-name>
<from-view-id>jsp/AddApplication.jsp</from-view-id>
<navigation-case>
<from-action>#{AddApplicationPage.saveApplication}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/jsp/main.jsp#addApp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

Any other insights are much appreciated, - Dave
+Pie Number of slices to send: Send
Hi,

use

+Pie Number of slices to send: Send
Thanks. That worked in as far as I'm redirected to my main page now. But I have yet another question. I'm trying to pass a parameter to main.jsp ...

<navigation-rule>
<display-name>jsp/AddApplication</display-name>
<from-view-id>/jsp/AddApplication.jsp</from-view-id>
<navigation-case>
<from-action>#{AddApplicationPage.saveApplication}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/jsp/main.jsp?i=1</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>


But it seems that the "?i=1" portion of the URL is getting dropped. Any way to preserve that?

- Dave
Hey cool! They got a blimp! But I have a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1079 times.
Similar Threads
Help. commandButton does not invoke Bean's method.
JSF <h:commandButton action> not working
JSF example problems
Providing anchor to columns in a datatable
Redirct of JSF page
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:15:38.