Navigation problem

Hello all,

I have a problem with JSF navigation and even though i read most of the solutions in the forum i I couldnt work it through.I hope u guyz can gimme a solution

I want simple navigation from one page to another based on action

from /page1.hello to /page2.hello

here is my faces-config.xml

<navigation-rule>

<from-view-id>/web/test/menu1/page1.jsp</from-view-id>

<navigation-case>

<from-action>success</from-action>

<to-view-id>/web/test/menu1/page2.jsp</to-view-id>

</navigation-case>

<navigation-case>

<from-action>fail</from-action>

<to-view-id>/web/test/menu1/page3.jsp</to-view-id>

</navigation-case>

</navigation-rule>

In my page1.jsp I have the following code

<h:commandLink id="cmdlink" action="#{MyBean.getSomeData}">

<t:outputText value="#{table.col1}"/>

</h:commandLink>

and this is the code in the MyBean class

public String getSomeData()

{

try

{

Bean1 rowData = (Bean1)tableModel.getRowData();

return"success";

}

catch(Exception e)

{

e.printStackTrace();

return"fail";

}

}

I have also used <h:messages/> but dont get any message.When i click in page1.jsp it just returns to the same page without going anywhere...anything i might have missed out?

best wishes

Neo

[1974 byte] By [Neoreborna] at [2007-10-3 0:28:25]
# 1
Use from-outcome instead of from-action.Or if you really want to use from-action, then do<from-action>#{MyBean.getSomeData}</from-action><from-outcome>theReturnedString</from-outcome>
BalusCa at 2007-7-14 17:21:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Yes ive tried it as well before but doesnt work

<navigation-rule>

<from-view-id>/web/test/menu1/page1.jsp</from-view-id>

<navigation-case>

<from-action>#{MyBean.getSomeData}</from-action>

<from-outcome>success</from-outcome> <to-view-id>/web/test/menu1/page2.jsp</to-view-id>

</navigation-case>

<navigation-case>

<from-action>#{MyBean.getSomeData}</from-action>

<from-outcome>fail</from-outcome><to-view-id>/web/test/menu1/page3.jsp</to-view-id>

</navigation-case>

</navigation-rule>

Do you think that the faces context is not being loaded for page2? Both and in the same directory

Message was edited by:

Neoreborn

Neoreborna at 2007-7-14 17:21:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
How did you define "MyBean" in faces-config.xmlcould be something to investigate.And also some messages to ensure that you return "SUCCESS"
rlepretrea at 2007-7-14 17:21:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...