• 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

navigation problem from main menu

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a commandlink with action: "#{incident.init}" . It works on a test jsp page. When I click on the link, the action is triggered and ends with the proper return "init" , control goes to faces-config.xml, look-up "from-outcome" and goes to "to-view-id" then the new page displays. Problem: the same link won't work on the main menu. Same commandlink with action"#{incident.init}" , same return: "init". I have System.out.println() and the method is called. But the control is back on the main menu. Somehow, it doesn't find or doesn't go to faces-config.xml. Any idea what I'm missing. Below is some code I use in the application.



// commandlink in jsp
<h:commandLink action="#{incident.init}">
<h:outputText value="Create Incident"/>
</h:commandLink>

faces-config.xml code:
<managed-bean>
<description>
Backing bean for incident Record.
</description>
<managed-bean-name>incident</managed-bean-name>
<managed-bean-class>
com.jsf.beans.IncidentBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>

<navigation-rule>
..
<navigation-case>
<from-action>#{incident.init}</from-action>
<from-outcome>init</from-outcome>
<to-view-id>/pages/outbreakIncMaint.jsp</to-view-id>
</navigation-case>
..
</navigation-rule>


public class IncidentBean {
public String init() {

System.out.println( "IncidentBean init.. BEGIN" );
// some code

System.out.println( "IncidentBean init.. END" );
return "init";
}
}
 
Don't touch me. And dont' touch this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic