• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why isn't redirct working?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

use

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic