You could use a redirect instead. If you are using extension mapping *.jsf the following redirect should work.

<%
response.sendRedirect(response.encodeRedirectURL("/pages/launch.jsf"));
%>

Thomas

On 9/16/05, Robert Taylor <[EMAIL PROTECTED]> wrote:
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>


I keep getting a 404 error. The HTTP request is for /test/app/launch,
but the 404 error indicates it cannot find /test/launch.

The log files reflect the following:

2005-09-15 17:39:05,140 [http-8080-Processor24] DEBUG
org.apache.myfaces.lifecycle.LifecycleImpl - entering restoreView in
org.apache.myfaces.lifecycle.LifecycleImpl
2005-09-15 17:39:05,187 [http-8080-Processor24] DEBUG
org.apache.myfaces.application.jsp.JspStateManagerImpl - No tree
structure state found in client request
2005-09-15 17:39:05,234 [http-8080-Processor24] DEBUG
org.apache.myfaces.application.jsp.JspViewHandlerImpl - Created view /launch
2005-09-15 17:39:05,312 [http-8080-Processor24] DEBUG
org.apache.myfaces.util.DebugUtils - Newly created view
========================================
<UIViewRoot id="NULL" family="javax.faces.ViewRoot" transient="false"
rendered="true" rendererType="NULL" locale="en" rendersChildren="false"
renderKitId="HTML_BASIC" viewId="/launch"/>
========================================

2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG
org.apache.myfaces.lifecycle.LifecycleImpl - exiting restoreView in
org.apache.myfaces.lifecycle.LifecycleImpl (--> render response)
2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG
org.apache.myfaces.lifecycle.LifecycleImpl - entering renderResponse in
org.apache.myfaces.lifecycle.LifecycleImpl
2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG
org.apache.myfaces.webapp.webxml.WebXmlParser - adding mapping for
servlet + Faces Servlet urlpattern = /app/*
2005-09-15 17:39:05,359 [http-8080-Processor24] DEBUG
org.apache.myfaces.application.jsp.JspViewHandlerImpl - Dispatching to
/launch
2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG
org.apache.myfaces.util.DebugUtils - View after rendering
========================================
<UIViewRoot id="NULL" family="javax.faces.ViewRoot" transient="false"
rendered="true" rendererType="NULL" locale="en" rendersChildren="false"
renderKitId="HTML_BASIC" viewId="/launch"/>
========================================

2005-09-15 17:39:05,468 [http-8080-Processor24] DEBUG
org.apache.myfaces.lifecycle.LifecycleImpl - exiting renderResponse in
org.apache.myfaces.lifecycle.LifecycleImpl


Any ideas, suggestions, RTFM, etc... would be helpful. I have read
through the JSF spec. regarding the navigation and I still can't figure
out what I have misconfigured. I even tried removing the
<from-view-id>/launch</from-view-id> altogether to make sure the
<navigaction-case/> would execute but still get the same error.

/robert





Reply via email to