Well, via the navigation rules you can define a complete rule such as:
<navigation-rule>
<from-view-id>/page1.jsf</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/page2.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/page3.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/page4.jsp</to-view-id>
</navigation-case>
</navigation-rule>
This would give you some abstraction in that the backing beans only have to
return "success"; the navigation rule will decide where to go. It doesn't get
you into a specific backing bean on the inbound path (as views/backing beans
are typically tightly coupled), it is probably not something that you want to
do.
-----Original Message-----
From: Eric Chentao Hu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 21, 2006 4:09 PM
To: MyFaces Discussion
Subject: RE: Struts-action-mapping-like capability in JSF
It's OK and thanks for the responses. I guess I'm looking for another level of
abstraction / indirection. In Struts you can specify a so-called action path
which is really a URL mapping to forward the request to an action which is
really a Java method. In JSF, can something similar to this be done easily?
Basically if you request a page some-page.jsf, a backing bean method will get
called, and then a particular view will be forwarded to depending on the result
returned from that backing bean method.
"Nebinger, David" <[EMAIL PROTECTED]> wrote:
Sorry, Eric, but your question is still not completely clear, but I'll take a
swag at it...
Specific inbound URL mapping is not, I don't believe, supported as the whole
JSF lifecycle includes the restoration of the view root; any inbound URL may or
may not have the appropriate view information available for restoration before
hitting one of the backing beans.
Perhaps if you could tell us exactly what you're trying to do, we could help
identify a JSF-compatible solution without trying to guess exactly the kind of
answer that you're looking to hear.
-----Original Message-----
From: Eric Chentao Hu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 21, 2006 3:45 PM
To: [email protected]
Subject: Struts-action-mapping-like capability in JSF
I meant url --> beacking bean method mapping. I don't want to go the
result page directly.
On 11/21/06, Nebinger, David <[EMAIL PROTECTED]> wrote:> What would be the best
way of doing this in JSF?
Um, have you actually read anything about JSF?
I mean anyone who RTFM would know that the navigation rules provide the
string->result page mapping as struts provides...
_____
Sponsored Link
Rates near 39yr lows. $420,000 Loan for $1399/mo - Calculate
<http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9136-16418&moid=4116>
new house payment
_____
Sponsored Link
Rates near 39yr lows. $420,000 Loan for $1399/mo - Calculate
<http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9136-16418&moid=4116>
new house payment