Robert Taylor wrote the following on 9/15/2005 6:12 PM:
Greetings, I'm a current Struts user interested in learning and using MyFaces and JSF.

My dev. env. consists of Tomcat 5.5.9, MyFaces 1.0.9, JDK 1.4.2, Win2K.

I've configured MyFaces to use Tiles for view-handler.

What I want to do is to have my welcome page (index.jsp), forward to a launch page for the application.

In Struts, I would simply use a <jsp:forward page="/app/launch"/>.
In my struts-config.xml file I has an action mapping for <action path="/launch" forward="launch.tile"/> which forwarded to a tiles configuration which builds the page.

I'm trying to do something similar with JSF, but have been unsuccessful.
I removed the "tiles" complexity just to see if it would display a non-tiles .jsp. My wecome page consists of a single line:
<jsp:forward page="/app/launch"/>.

My faces-context.xml file is as follows:

<?xml version="1.0"?>

<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd"; >

<faces-config>

    <navigation-rule>
        <from-view-id>/launch</from-view-id>
        <navigation-case>
            <to-view-id>/pages/launch.jsp</to-view-id>
        </navigation-case>

    </navigation-rule>

</faces-config>

How's it going Robert. Good to see you here:)

I'm not totally sure of the interaction/effects of using .faces (assuming you have in you web.xml:

<servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
   </servlet-mapping>
 )
but what should work  is....

<jsp:forward page="/app/launch.faces"/>

<navigation-rule>
        <navigation-case>
            <from-outcome>app/launch</from-outcome>
            <to-view-id>/pages/launch.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

Someone please correct if what I'm doing above is the wrong approach (as I'm using it in the online example I wrote and I want to be doing the correct thing http://www.reumann.net/reumann/jsf/jsf_employees/ )

Reply via email to