I extracted the sources from the Woodstock example war file the other
day and created a netbeans project for it.
To go around that same exact problem I created a forward.jsp file like
this (the key here is to forward via JSF):
<%_at_page contentType="text/html"%>
<%_at_page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Woodstock Samples</title>
</head>
<body>
<h1>Woodstock Samples</h1>
<br/>
<jsp:forward page="/faces/index.jsp" />
</body>
</html>
and then added forward.jsp to the welcome file list of the web.xml file :
<!-- Welcome File List -->
<welcome-file-list>
<welcome-file>forward.jsp</welcome-file>
<!--
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
-->
</welcome-file-list>
HTH
Alejandro
Ken Paulsen wrote:
>
> Hi Senthil / Anissa,
>
> I haven't finished making this "user-friendly" (nor has Lockhart!).
> They use a prefix mapping and generate many of their URLs improperly
> (making switching to suffix mapping non-trivial -- have to change a
> bunch of .java files).
>
> Anyway, they don't include a proper welcome file (senthil you where on
> the right track), so you have to type a URL that looks something like:
>
> http://localhost:8008/woodstock/faces/index.jsf
>
> WARNING: I haven't checked in all the files. And I haven't yet tested
> what I have checked in... so it is very possible I missed something
> that is required. I hope to finish the conversion of this JSP app to
> JSF tonight. I performing a mechanical conversion that doesn't change
> the app design to take advantage of JSFTemplating... so there are few
> if any handlers, and the app makes heavy use of backing beans /
> navigation rules, etc. So it's a good chance to see "the other way"
> to write JSF apps. :) Still serves as a good example of the Woodstock
> components, though.
>
> Thanks,
>
> Ken
>
> Senthil Chidambaram wrote:
>> Anissa,
>> Could you pls try changing your welcome-file to index.jsf, or add an
>> entry for index.jsf, and see whether this solves your problem.
>>
>> thx
>> Senthil
>>
>> Anissa Lam wrote:
>>
>>> Senthil Chidambaram wrote:
>>>
>>>> Anissa,
>>>> Could you please email your web.xml file.
>>>
>>> I attached it here. This is the exact same copy from cvs
>>> checkout. The REAME file didn't say i need to change anything.
>>>
>>> thanks
>>> Anissa
>>>
>>>>
>>>> thx
>>>> Senthil
>>>>
>>>> Anissa Lam wrote:
>>>>
>>>>>
>>>>> I am able to build woodstock.war, and deploy it with context root
>>>>> set to 'woodstock'
>>>>> But when i try to run it,
>>>>> http://localhost:8080/woodstock/
>>>>> I got the directory listing, and clicking on any file, eg
>>>>> index.jsf, the browser shows me the file content itself.
>>>>>
>>>>> What did i miss ?
>>>>>
>>>>> thanks
>>>>> Anissa.
>>>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>> The contents of this file are subject to the terms
>>> of the Common Development and Distribution License
>>> (the License). You may not use this file except in
>>> compliance with the License.
>>>
>>> You can obtain a copy of the license at
>>> https://woodstock.dev.java.net/public/CDDLv1.0.html.
>>> See the License for the specific language governing
>>> permissions and limitations under the License.
>>>
>>> When distributing Covered Code, include this CDDL
>>> Header Notice in each file and include the License file
>>> at https://woodstock.dev.java.net/public/CDDLv1.0.html.
>>> If applicable, add the following below the CDDL Header,
>>> with the fields enclosed by brackets [] replaced by
>>> you own identifying information:
>>> "Portions Copyrighted [year] [name of copyright owner]"
>>>
>>> Copyright 2007 Sun Microsystems, Inc. All rights reserved.
>>> -->
>>> <web-app version="2.5"
>>> xmlns="http://java.sun.com/xml/ns/javaee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
>>>
>>> <context-param>
>>> <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>>> <param-value>server</param-value>
>>> </context-param>
>>>
>>> <context-param>
>>> <param-name>com.sun.jsftemplating.DEBUG</param-name>
>>> <param-value>true</param-value>
>>> </context-param>
>>>
>>> <context-param>
>>> <param-name>com.sun.webui.jsf.DEFAULT_THEME</param-name>
>>> <param-value>suntheme</param-value>
>>> </context-param>
>>>
>>> <!-- Upload Filter -->
>>> <filter>
>>> <filter-name>UploadFilter</filter-name>
>>> <filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
>>> <init-param>
>>> <param-name>maxSize</param-name>
>>> <param-value>1000000</param-value> </init-param> <init-param>
>>> <param-name>sizeThreshold</param-name>
>>> <param-value>4096</param-value> </init-param> </filter>
>>>
>>> <!-- Upload Filter Mapping -->
>>> <filter-mapping> <filter-name>UploadFilter</filter-name>
>>> <servlet-name>FacesServlet</servlet-name> </filter-mapping>
>>>
>>> <!-- Faces Servlet -->
>>> <servlet>
>>> <servlet-name>FacesServlet</servlet-name>
>>> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>> <init-param>
>>> <param-name>javax.faces.LIFECYCLE_ID</param-name>
>>> <param-value>com.sun.faces.lifecycle.PARTIAL</param-value>
>>> </init-param>
>>> <load-on-startup>1</load-on-startup>
>>> </servlet>
>>>
>>> <!-- Theme Servlet -->
>>> <servlet>
>>> <servlet-name>ThemeServlet</servlet-name>
>>> <servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>
>>> <load-on-startup>2</load-on-startup>
>>> </servlet> <!-- Faces Servlet Mapping -->
>>> <servlet-mapping>
>>> <servlet-name>FacesServlet</servlet-name>
>>> <url-pattern>/faces/*</url-pattern>
>>> </servlet-mapping>
>>>
>>> <!-- Theme Servlet Mapping -->
>>> <servlet-mapping>
>>> <servlet-name>ThemeServlet</servlet-name>
>>> <url-pattern>/theme/*</url-pattern>
>>> </servlet-mapping> <session-config>
>>> <session-timeout>30</session-timeout>
>>> </session-config>
>>>
>>> <!-- Welcome File List --> <welcome-file-list>
>>> <welcome-file>index.jsp</welcome-file>
>>> <welcome-file>index.html</welcome-file>
>>> <welcome-file>index.htm</welcome-file>
>>> </welcome-file-list> </web-app>
>>>
>>>