You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/09/19 08:25:02 UTC

svn commit: r447760 - in /myfaces: shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/ tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/ tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/ tomahawk/trunk/e...

Author: mmarinschek
Date: Mon Sep 18 23:25:01 2006
New Revision: 447760

URL: http://svn.apache.org/viewvc?view=rev&rev=447760
Log:
Added support for managed-beans to source-code-servlet. Need to replicate this to all pages. Added new context-params to all sample web-apps

Added:
    myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/
    myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessTrackingVariableResolver.java
    myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessedBeans.java
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/inc/mbean_source.jsp
Modified:
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java
    myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/aliasBean.jsp
    myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/examples/wap/src/main/webapp/WEB-INF/web.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/servlet/SourceCodeServlet.java Mon Sep 18 23:25:01 2006
@@ -28,14 +28,43 @@
         String webPage = req.getServletPath();
         
         // remove the '*.source' suffix that maps to this servlet
-        int chopPoint = webPage.indexOf(".source");
+        int chopPoint = webPage.lastIndexOf(".source");
         
-        webPage = webPage.substring(0, chopPoint - 1);
-        webPage += "p"; // replace jsf with jsp
-        
-        // get the actual file location of the requested resource
-        String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+        webPage = webPage.substring(0, chopPoint);
+
+        if(webPage.endsWith(".jsf"))
+        {
+            int jsfChopPoint = webPage.lastIndexOf(".jsf");
+
+            webPage = webPage.substring(0, jsfChopPoint);
+
+            webPage += ".jsp"; // replace jsf with jsp
+
+            // get the actual file location of the requested resource
+            String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+            outputFile(res, realPath);
+        }
+        else
+        {
+            int beginChopPoint = webPage.lastIndexOf("/");
+            int extensionChopPoint = webPage.lastIndexOf(".java");
+
+            webPage = webPage.substring(beginChopPoint+1,extensionChopPoint);
+
+            webPage = "/WEB-INF/classes"+webPage.replace('.','/')+".java";
+
+            // get the actual file location of the requested resource
+            String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+            outputFile(res, realPath);
+            
+        }
+    }
 
+    private void outputFile(HttpServletResponse res, String realPath)
+            throws IOException
+    {
         // output an HTML page
         res.setContentType("text/plain");
 
@@ -44,11 +73,11 @@
 
         // print the file
         InputStream in = null;
-        try 
+        try
         {
             in = new BufferedInputStream(new FileInputStream(realPath));
             int ch;
-            while ((ch = in.read()) !=-1) 
+            while ((ch = in.read()) !=-1)
             {
                 out.print((char)ch);
             }

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AddResourceFactory.java Mon Sep 18 23:25:01 2006
@@ -41,7 +41,7 @@
 /**
  * This class provides the ability to instantiate AddResource objects. By
  * default, this class will instantiate instances of
- * org.apache.myfaces.component.html.util.DefaultAddResource. However, the
+ * org.apache.myfaces.renderkit.html.util.DefaultAddResource. However, the
  * context parameter org.apache.myfaces.ADD_RESOURCE_CLASS can specify an
  * alternative implementation of the AddResource interface. The class must have
  * a constructor with a single String argument, representing the context path.

Modified: myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/blank/src/main/webapp/WEB-INF/web.xml Mon Sep 18 23:25:01 2006
@@ -87,6 +87,35 @@
        	<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
     </context-param>
+  <context-param>
+    <description>A class implementing the
+		    org.apache.myfaces.shared.renderkit.html.util.AddResource
+		    interface. It is responsible to
+   			place scripts and css on the right position in your HTML document.
+            Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
+            Follow the description on the MyFaces-Wiki-Performance page to enable
+            StreamingAddResource instead of DefaultAddResource if you want to
+            gain performance.
+    </description>
+    <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+    <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+    <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
+  </context-param>
+
+  <context-param>
+    <description>
+        A very common problem in configuring MyFaces-web-applications
+        is that the Extensions-Filter is not configured at all
+        or improperly configured. This parameter will check for a properly
+        configured Extensions-Filter if it is needed by the web-app.
+        In most cases this check will work just fine, there might be cases
+        where an internal forward will bypass the Extensions-Filter and the check
+        will not work. If this is the case, you can disable the check by setting
+        this parameter to false.
+    </description>
+    <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+    <param-value>true</param-value>
+  </context-param>
 
   <filter>
     <filter-name>extensionsFilter</filter-name>

Added: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessTrackingVariableResolver.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessTrackingVariableResolver.java?view=auto&rev=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessTrackingVariableResolver.java (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessTrackingVariableResolver.java Mon Sep 18 23:25:01 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.accessedbeans;
+
+import javax.faces.el.VariableResolver;
+import javax.faces.el.EvaluationException;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class AccessTrackingVariableResolver extends VariableResolver
+{
+    private VariableResolver delegate;
+
+    /**Implementing delegate-pattern
+     *
+     * @param delegate Delegating to this instance.
+     */
+    public AccessTrackingVariableResolver(VariableResolver delegate)
+    {
+        this.delegate = delegate;
+    }
+
+    // METHODS
+    public Object resolveVariable(FacesContext facesContext, String name) throws EvaluationException
+    {
+        Object resolvedBean = delegate.resolveVariable(facesContext, name);
+
+        if(!(resolvedBean instanceof AccessedBeans) && resolvedBean!=null)
+        {
+            ((AccessedBeans) facesContext.getApplication().
+                    getVariableResolver().resolveVariable(facesContext,"accessedBeans")).addBean(name, resolvedBean);
+        }
+
+        return resolvedBean;
+    }
+}

Added: myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessedBeans.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessedBeans.java?view=auto&rev=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessedBeans.java (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/java/org/apache/myfaces/examples/accessedbeans/AccessedBeans.java Mon Sep 18 23:25:01 2006
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.examples.accessedbeans;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class AccessedBeans
+{
+    private List beanList;
+
+    public List getBeanList()
+    {
+        if(beanList == null)
+            beanList = new ArrayList();
+
+        return beanList;
+    }
+
+    public void setBeanList(List beanList)
+    {
+        this.beanList = beanList;
+    }
+
+    public void addBean(String name, Object resolvedBean)
+    {
+        List li = getBeanList();
+
+        for (int i = 0; i < li.size(); i++)
+        {
+            AccessedBean accessedBean = (AccessedBean) li.get(i);
+            if(accessedBean.getName().equals(name))
+                return;
+        }
+
+        AccessedBean bean = new AccessedBean();
+        bean.setName(name);
+        bean.setClazz(resolvedBean.getClass().getName());
+
+        li.add(bean);
+    }
+
+    public static class AccessedBean
+    {
+        private String name;
+        private String clazz;
+
+        public String getName()
+        {
+            return name;
+        }
+
+        public void setName(String name)
+        {
+            this.name = name;
+        }
+
+        public String getClazz()
+        {
+            return clazz;
+        }
+
+        public void setClazz(String clazz)
+        {
+            this.clazz = clazz;
+        }
+    }
+}

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/examples-config.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/examples-config.xml Mon Sep 18 23:25:01 2006
@@ -10,6 +10,16 @@
 
 <faces-config>
 
+    <application>
+        <variable-resolver>org.apache.myfaces.examples.accessedbeans.AccessTrackingVariableResolver</variable-resolver>
+    </application>
+
+    <!-- Accessed beans on the last request -->
+    <managed-bean>
+        <managed-bean-name>accessedBeans</managed-bean-name>
+        <managed-bean-class>org.apache.myfaces.examples.accessedbeans.AccessedBeans</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+    </managed-bean>
 
     <!-- Managed Beans for sample1.jsp -->
 

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/web.xml Mon Sep 18 23:25:01 2006
@@ -79,17 +79,35 @@
        	<param-value>true</param-value>
     </context-param>
 
-<!--
   <context-param>
     <description>A class implementing the
 		    org.apache.myfaces.shared.renderkit.html.util.AddResource
 		    interface. It is responsible to
    			place scripts and css on the right position in your HTML document.
-            Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"</description>
+            Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
+            Follow the description on the MyFaces-Wiki-Performance page to enable
+            StreamingAddResource instead of DefaultAddResource if you want to
+            gain performance.
+    </description>
     <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
-    <param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value>
+    <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+    <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
+  </context-param>
+
+  <context-param>
+    <description>
+        A very common problem in configuring MyFaces-web-applications
+        is that the Extensions-Filter is not configured at all
+        or improperly configured. This parameter will check for a properly
+        configured Extensions-Filter if it is needed by the web-app.
+        In most cases this check will work just fine, there might be cases
+        where an internal forward will bypass the Extensions-Filter and the check
+        will not work. If this is the case, you can disable the check by setting
+        this parameter to false.
+    </description>
+    <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+    <param-value>true</param-value>
   </context-param>
--->
   
   <filter>
     <filter-name>extensionsFilter</filter-name>

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/aliasBean.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/aliasBean.jsp?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/aliasBean.jsp (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/aliasBean.jsp Mon Sep 18 23:25:01 2006
@@ -108,6 +108,8 @@
         <h:commandButton/>
     </h:form>
 
+    <jsp:include page="inc/mbean_source.jsp"/>
+
 </f:view>
 
 <%@include file="inc/page_footer.jsp" %>

Added: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/inc/mbean_source.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/inc/mbean_source.jsp?view=auto&rev=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/inc/mbean_source.jsp (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/inc/mbean_source.jsp Mon Sep 18 23:25:01 2006
@@ -0,0 +1,16 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<br/>
+<br/>
+
+<t:dataList value="#{accessedBeans.beanList}" var="accessedBean" layout="unorderedList">
+    <h:outputLink value="#{request.requestURI}/#{accessedBean.clazz}.java.source">
+        <h:outputText value="Show source of bean with name : "/>
+        <h:outputText value="#{accessedBean.name}"/>
+        <h:outputText value=" and class : "/>
+        <h:outputText value="#{accessedBean.clazz}"/>
+    </h:outputLink>
+</t:dataList>

Modified: myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/tiles/src/main/webapp/WEB-INF/web.xml Mon Sep 18 23:25:01 2006
@@ -5,7 +5,7 @@
     <description>Comma separated list of URIs of (additional) faces config files.
             (e.g. /WEB-INF/my-config.xml)
             See JSF 1.0 PRD2, 10.3.2
-            Attention: You do not have to put /WEB-INF/faces-config.xml in here.
+            Attention: You may not put /WEB-INF/faces-config.xml in here.
     </description>
     <param-name>javax.faces.CONFIG_FILES</param-name>
     <param-value>/WEB-INF/examples-config.xml</param-value>
@@ -86,7 +86,36 @@
   		</description>
        	<param-name>org.apache.myfaces.VALIDATE</param-name>
        	<param-value>true</param-value>
-    </context-param>  
+    </context-param>
+  <context-param>
+    <description>A class implementing the
+		    org.apache.myfaces.shared.renderkit.html.util.AddResource
+		    interface. It is responsible to
+   			place scripts and css on the right position in your HTML document.
+            Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
+            Follow the description on the MyFaces-Wiki-Performance page to enable
+            StreamingAddResource instead of DefaultAddResource if you want to
+            gain performance.
+    </description>
+    <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+    <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+    <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
+  </context-param>
+
+  <context-param>
+    <description>
+        A very common problem in configuring MyFaces-web-applications
+        is that the Extensions-Filter is not configured at all
+        or improperly configured. This parameter will check for a properly
+        configured Extensions-Filter if it is needed by the web-app.
+        In most cases this check will work just fine, there might be cases
+        where an internal forward will bypass the Extensions-Filter and the check
+        will not work. If this is the case, you can disable the check by setting
+        this parameter to false.
+    </description>
+    <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+    <param-value>true</param-value>
+  </context-param>
   
       <!-- Tiles ViewHandler config file --> 	 
      <context-param> 	 

Modified: myfaces/tomahawk/trunk/examples/wap/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/wap/src/main/webapp/WEB-INF/web.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/examples/wap/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/examples/wap/src/main/webapp/WEB-INF/web.xml Mon Sep 18 23:25:01 2006
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 
 <!--
  * Copyright 2004 The Apache Software Foundation.
@@ -16,38 +16,124 @@
  * limitations under the License.
 -->
 
-<!DOCTYPE web-app PUBLIC
-  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-  "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
 
 
     <context-param>
-        <param-name>javax.faces.CONFIG_FILES</param-name>
-        <param-value>
-            /WEB-INF/wap-faces-config.xml
-        </param-value>
-        <description>
-            Comma separated list of URIs of (additional) faces config files.
-            (e.g. /WEB-INF/my-config.xml)
-            See JSF 1.0 PRD2, 10.3.2
-            Attention: You do not need to put /WEB-INF/faces-config.xml in here.            
-        </description>
+      <description>Comma separated list of URIs of (additional) faces config files.
+              (e.g. /WEB-INF/my-config.xml)
+              See JSF 1.0 PRD2, 10.3.2
+              Attention: You may not put /WEB-INF/faces-config.xml in here.
+      </description>
+      <param-name>javax.faces.CONFIG_FILES</param-name>
+      <param-value>/WEB-INF/examples-config.xml</param-value>
+    </context-param>
+    <context-param>
+      <description>State saving method: "client" or "server" (= default)
+              See JSF Specification 2.5.3</description>
+      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+      <param-value>client</param-value>
+    </context-param>
+    <context-param>
+      <description>Only applicable if state saving method is "server" (= default).
+              Defines the amount (default = 20) of the latest views are stored in session.</description>
+      <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
+      <param-value>20</param-value>
+    </context-param>
+    <context-param>
+      <description>Only applicable if state saving method is "server" (= default).
+              If true (default) the state will be serialized to a byte stream before it
+              is written to the session.
+              If false the state will not be serialized to a byte stream.</description>
+      <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
+      <param-value>true</param-value>
+    </context-param>
+    <context-param>
+      <description>Only applicable if state saving method is "server" (= default) and if
+              org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
+              If true (default) the serialized state will be compressed before it
+              is written to the session. If false the state will not be compressed.</description>
+      <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
+      <param-value>true</param-value>
+    </context-param>
+    <context-param>
+      <description>This parameter tells MyFaces if javascript code should be allowed in the
+              rendered HTML output.
+              If javascript is allowed, command_link anchors will have javascript code
+              that submits the corresponding form.
+              If javascript is not allowed, the state saving info and nested parameters
+              will be added as url parameters.
+              Default: "true"</description>
+      <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+      <param-value>true</param-value>
+    </context-param>
+    <context-param>
+      <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+      <param-value>false</param-value>
+    </context-param>
+    <context-param>
+      <description>If true, rendered HTML code will be formatted, so that it is "human readable".
+              i.e. additional line separators and whitespace will be written, that do not
+              influence the HTML code.
+              Default: "true"</description>
+      <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+      <param-value>true</param-value>
+    </context-param>
+    <context-param>
+      <description>If true, a javascript function will be rendered that is able to restore the
+              former vertical scroll on every request. Convenient feature if you have pages
+              with long lists and you do not want the browser page to always jump to the top
+              if you trigger a link or button action that stays on the same page.
+              Default: "false"</description>
+      <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+      <param-value>true</param-value>
     </context-param>
 
+      <context-param>
+          <description> Used for encrypting view state.  Only relevant for client side
+              state saving.  See MyFaces wiki/web site documentation for instructions
+              on how to configure an application for diffenent encryption strengths.
+          </description>
+          <param-name>org.apache.myfaces.SECRET</param-name>
+          <param-value>NzY1NDMyMTA=</param-value>
+      </context-param>
+
+      <context-param>
+            <description>
+                Validate managed beans, navigation rules and ensure that forms are not nested.
+            </description>
+             <param-name>org.apache.myfaces.VALIDATE</param-name>
+             <param-value>true</param-value>
+      </context-param>
     <context-param>
-        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
-        <param-value>server</param-value>
-        <description>
-            State saving method: "client" or "server" (= default)
-            See JSF Specification 2.5.3
-        </description>
-    </context-param>
-    <!-- Listener, that does all the startup work (configuration, init). -->
-    <listener>
-        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-    </listener>
+      <description>A class implementing the
+              org.apache.myfaces.shared.renderkit.html.util.AddResource
+              interface. It is responsible to
+                 place scripts and css on the right position in your HTML document.
+              Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
+              Follow the description on the MyFaces-Wiki-Performance page to enable
+              StreamingAddResource instead of DefaultAddResource if you want to
+              gain performance.
+      </description>
+      <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+      <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+      <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
+    </context-param>
+
+    <context-param>
+      <description>
+          A very common problem in configuring MyFaces-web-applications
+          is that the Extensions-Filter is not configured at all
+          or improperly configured. This parameter will check for a properly
+          configured Extensions-Filter if it is needed by the web-app.
+          In most cases this check will work just fine, there might be cases
+          where an internal forward will bypass the Extensions-Filter and the check
+          will not work. If this is the case, you can disable the check by setting
+          this parameter to false.
+      </description>
+      <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+      <param-value>true</param-value>
+    </context-param>
 
 
     <!-- Faces Servlet -->

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/web.xml?view=diff&rev=447760&r1=447759&r2=447760
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/web.xml Mon Sep 18 23:25:01 2006
@@ -50,6 +50,52 @@
     <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
     <param-value>true</param-value>
   </context-param>
+      <context-param>
+          <description> Used for encrypting view state.  Only relevant for client side
+              state saving.  See MyFaces wiki/web site documentation for instructions
+              on how to configure an application for diffenent encryption strengths.
+          </description>
+          <param-name>org.apache.myfaces.SECRET</param-name>
+          <param-value>NzY1NDMyMTA=</param-value>
+      </context-param>
+
+      <context-param>
+            <description>
+                Validate managed beans, navigation rules and ensure that forms are not nested.
+            </description>
+             <param-name>org.apache.myfaces.VALIDATE</param-name>
+             <param-value>true</param-value>
+      </context-param>
+    <context-param>
+      <description>A class implementing the
+              org.apache.myfaces.shared.renderkit.html.util.AddResource
+              interface. It is responsible to
+                 place scripts and css on the right position in your HTML document.
+              Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
+              Follow the description on the MyFaces-Wiki-Performance page to enable
+              StreamingAddResource instead of DefaultAddResource if you want to
+              gain performance.
+      </description>
+      <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+      <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+      <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
+    </context-param>
+
+    <context-param>
+      <description>
+          A very common problem in configuring MyFaces-web-applications
+          is that the Extensions-Filter is not configured at all
+          or improperly configured. This parameter will check for a properly
+          configured Extensions-Filter if it is needed by the web-app.
+          In most cases this check will work just fine, there might be cases
+          where an internal forward will bypass the Extensions-Filter and the check
+          will not work. If this is the case, you can disable the check by setting
+          this parameter to false.
+      </description>
+      <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+      <param-value>true</param-value>
+    </context-param>
+
   <context-param>
     <description>Set the redirectTracker policy. You can use your own implementation by providing the
 		  FQN of the class here.