Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using view and subview ID in JSF Navigation <from-view-id>

843842Oct 25 2004 — edited Feb 8 2008
Hi guys, I have a hard to time to solve a navigation problem: I have a simple page which include dynamically another page. I want to manage their navigation in separate navigation rules to be able to reuse "outcome" names. I though that using the <from-view-id> tag would help me in that matter, but unfortunately, it always refer to the page having the main view tag in.

Here�s the content of layout.jsp:
<%@ taglib uri="http://java.sun.com/jsf/core"  prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html"  prefix="h" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<c:import url="${book.directory}/${chapter}.html"/>
<HTML>
  <f:view id="main">
    <table border="1" width="100%" >
      <tr>
        <f:subview id="content">
          <td><c:import url="/content.jsp"/></TD>
        </f:subview>
      </tr>
    </TABLE>
   </f:view>
 </HTML>
Here�s my faces-config:
<faces-config>
  <navigation-rule>
    <from-view-id>/layout.jsp</from-view-id>
      <navigation-case>
          <from-outcome>success</from-outcome>
          <to-view-id>/test.jsp</to-view-id>
      </navigation-case>
  </navigation-rule>
  
  <navigation-rule>
    <from-view-id>/content.jsp</from-view-id>
      <navigation-case>
        <from-outcome>success</from-outcome>
        <to-view-id>/test2.jsp</to-view-id>
      </navigation-case>
  </navigation-rule>
</faces-config>
So, I want to know if it's possible to use something else than the JSP file name (like the view and subview ID's) in the navigation rules to be more precise about where I come from?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2008
Added on Oct 25 2004
7 comments
882 views