2 Replies Latest reply on Feb 26, 2008 2:51 PM by EM Ahmed

    Richfaces + myFaces + Example

    Markus Pf Newbie

      i tried to replicatethe example from http://livedemo.exadel.com/richfaces-demo/richfaces/gmap.jsf;jsessionid=0CAEFE2DAE009941037E594222BDF09B?c=gmap
      and now i get following Exception:


      2007-05-10 17:30:51 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
      2007-05-10 17:30:51 StandardContext[/jsp-examples]ContextListener: contextInitialized()
      2007-05-10 17:30:51 StandardContext[/jsp-examples]SessionListener: contextInitialized()
      2007-05-10 17:30:51 StandardContext[/servlets-examples]ContextListener: contextInitialized()
      2007-05-10 17:30:51 StandardContext[/servlets-examples]SessionListener: contextInitialized()
      2007-05-10 17:31:18 ApplicationDispatcher[/richFaces] Servlet.service() for servlet jsp threw exception
      javax.faces.FacesException: Could not get property gmapKey of component _idJsp1
      at javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:392)
      at javax.faces.component._ComponentAttributesMap.get(_ComponentAttributesMap.java:235)
      at org.richfaces.renderkit.html.GmapRenderer.doEncodeEnd(GmapRenderer.java:170)
      at org.richfaces.renderkit.html.GmapRenderer.doEncodeEnd(GmapRenderer.java:232)
      at org.ajax4jsf.framework.renderer.RendererBase.encodeEnd(RendererBase.java:114)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:688)
      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
      at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:229)
      at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:101)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:688)
      at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:670)
      at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:538)
      at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:57)
      at org.apache.jsp.richFaces_jsp._jspx_meth_h_panelGrid_0(richFaces_jsp.java:188)
      at org.apache.jsp.richFaces_jsp._jspx_meth_f_view_0(richFaces_jsp.java:131)
      at org.apache.jsp.richFaces_jsp._jspService(richFaces_jsp.java:95)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:387)
      ... 65 more
      Caused by: javax.faces.el.EvaluationException: Cannot get value for expression '#{gmBean.gmapkey}'
      at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:405)
      at org.richfaces.component.html.HtmlGmap.getGmapKey(HtmlGmap.java:260)
      ... 70 more
      Caused by: javax.faces.FacesException: java.lang.ClassNotFoundException: org.richfaces.demo.gmap
      at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:165)
      at org.apache.myfaces.shared_impl.util.ClassUtils.newInstance(ClassUtils.java:268)
      at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:49)
      at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:314)
      at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:570)
      at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
      at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
      at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
      ... 71 more
      Caused by: java.lang.ClassNotFoundException: org.richfaces.demo.gmap
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at org.apache.myfaces.shared_impl.util.ClassUtils.classForName(ClassUtils.java:141)
      at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:160)
      ... 78 more

      2007-05-10 17:31:18 StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
      javax.faces.FacesException: Could not get property gmapKey of component _idJsp1
      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:431)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.apache.jasper.JasperException: Could not get property gmapKey of component _idJsp1
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
      ... 37 more


      Mein Code:

      web.xml

      <?xml version="1.0"?>
      
      <!--
       * Licensed to the Apache Software Foundation (ASF) under one
       * or more contributor license agreements. See the NOTICE file
       * distributed with this work for additional information
       * regarding copyright ownership. The ASF licenses this file
       * to you 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.
      -->
      <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">
      
       <description>MyProject web.xml</description>
      
       <context-param>
       <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>
       <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>
       <description>
       Treat readonly same as if disabled attribute was set for select elements.
       </description>
       <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <context-param>
       <description>
       Use the defined class as the class which will be called when a resource is added to the
       ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add
       custom components and want to use the ExtensionFilter, you need to provide your custom implementation here.
       </description>
       <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
       <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
       </context-param>
      
       <context-param>
       <description>
       Virtual path in the URL which triggers loading of resources for the MyFaces extended components
       in the ExtensionFilter.
       </description>
       <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
       <param-value>/faces/myFacesExtensionResource</param-value>
       </context-param>
      
       <context-param>
       <description>
       Check if the extensions-filter has been properly configured.
       </description>
       <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <context-param>
       <description>
       Define partial state saving as true/false.
       </description>
       <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
       <param-value>false</param-value>
       </context-param>
      
       <!-- Extensions Filter -->
       <filter>
       <filter-name>extensionsFilter</filter-name>
       <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
       <init-param>
       <description>Set the size limit for uploaded files.
       Format: 10 - 10 bytes
       10k - 10 KB
       10m - 10 MB
       1g - 1 GB</description>
       <param-name>uploadMaxFileSize</param-name>
       <param-value>100m</param-value>
       </init-param>
       <init-param>
       <description>Set the threshold size - files
       below this limit are stored in memory, files above
       this limit are stored on disk.
      
       Format: 10 - 10 bytes
       10k - 10 KB
       10m - 10 MB
       1g - 1 GB</description>
       <param-name>uploadThresholdSize</param-name>
       <param-value>100k</param-value>
       </init-param>
       </filter>
      
       <filter-mapping>
       <filter-name>extensionsFilter</filter-name>
       <url-pattern>*.jsf</url-pattern>
       </filter-mapping>
       <filter-mapping>
       <filter-name>extensionsFilter</filter-name>
       <url-pattern>/faces/*</url-pattern>
       </filter-mapping>
      
       <!-- Listener, to allow Jetty serving MyFaces apps -->
       <listener>
       <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
       </listener>
      
       <!-- Faces Servlet -->
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <!-- Faces Servlet Mapping -->
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
      
       <!-- Welcome files -->
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       <welcome-file>index.html</welcome-file>
       </welcome-file-list>
      
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
      </web-app>
      


      faces config:

      <?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_1.dtd" >
      
      <faces-config>
      
       <!-- managed beans of the simple hello world app -->
       <managed-bean>
       <managed-bean-name>helloWorldBacking</managed-bean-name>
       <managed-bean-class>org.apache.myfaces.blank.HelloWorldBacking</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
      
       <managed-bean>
       <managed-bean-name>gmBean</managed-bean-name>
       <managed-bean-class>org.richfaces.demo.gmap</managed-bean-class>
       <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
      
       <!-- navigation rules for helloWorld.jsp -->
       <navigation-rule>
       <from-view-id>/helloWorld.jsp</from-view-id>
       <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/page2.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <!-- navigation rules for page2.jsp -->
       <navigation-rule>
       <from-view-id>/page2.jsp</from-view-id>
       <navigation-case>
       <from-outcome>back</from-outcome>
       <to-view-id>/helloWorld.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      </faces-config>
      


      bean.java

      package org.richfaces.demo.gmap;
      
      import java.util.ArrayList;
      import java.util.HashMap;
      import java.util.Iterator;
      
      import javax.faces.context.ExternalContext;
      import javax.faces.context.FacesContext;
      
      
      public class Bean {
      
       private ArrayList point;
       private String currentId;
       private int zoom;
       private String gmapkey;
      
      
       public String getCurrentId() {
       return currentId;
       }
      
      
      
       public void setCurrentId(String currentId) {
       this.currentId = currentId;
       }
      
      
      
       public ArrayList getPoint() {
       if (point == null)
       initData();
       return point;
       }
      
      
      
       public void setPoint(ArrayList point) {
       this.point = point;
       }
      
      
       public Place getCurrentPlace() {
       Iterator it = point.iterator();
       while (it.hasNext()) {
       Place pl = (Place)it.next();
       if (currentId.equals(pl.getId())) {
       zoom = pl.getZoom(); //sync with zoom of new place
       return pl;
       }
       }
       return (Place)point.get(0);
       }
      
       private void initData() {
       point = new ArrayList();
       point.add(new Place ("goldengate", "/org/richfaces/demo/gmap/images/gold.gif", "37.81765", "-122.477603" , 14,
       "Golden Gate Bridge, San Francisco"));
       point.add(new Place ("eiffeltower", "/org/richfaces/demo/gmap/images//tower.gif", "48.858489", "2.295295" , 17,
       "Eiffel Tower, Paris"));
       point.add(new Place ("pyramids", "/org/richfaces/demo/gmap/images/pyramids.gif", "29.977785", "31.132915" , 15,
       "Pyramids of Egypt, Giza"));
       point.add(new Place ("exadel", "/org/richfaces/demo/gmap/images/exadel.gif", "37.971796", "-122.042334" , 18,
       "Headquarter of Exadel, Inc , Concord"));
       currentId = "eiffeltower";
       }
      
      
      
       public int getZoom() {
       return zoom;
       }
      
      
      
       public void setZoom(int zoom) {
       this.zoom = zoom;
       }
      
      
      
       public String getGmapkey() {
       if (gmapkey == null) {
       gmapkey = createKey();
       }
       return gmapkey;
       }
      
       private String createKey() {
      
       HashMap hosts = new HashMap();
       hosts.put("localhost:8080", "ABQIAAAAU5IDceLqYFSp4k84FYLxyRTwM0brOpm-All5BF6PoaKBxRWWERSDiAIGyx-hbmMfA3v7tHF4Tvwfaw");
      
      // hosts.put("localhost", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRkrpOGzxH8_ud3inE9pG1845-FCA");
      // hosts.put("localhost:8080", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxTwM0brOpm-All5BF6PoaKBxRWWERTHxF5cK19oAMu3MP89kWdchuCH6w");
      // hosts.put("livedemo.exadel.com", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxRl-RYVoXwacweAQq3rWvtlmS78MhRst9EH2cahrIp0_HHi_U1Zn7o1Fg");
      
      // ABQIAAAAU5IDceLqYFSp4k84FYLxyRTwM0brOpm-All5BF6PoaKBxRWWERSDiAIGyx-hbmMfA3v7tHF4Tvwfaw
      
       ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
       String host = (String)ec.getRequestHeaderMap().get("host");
       String key = (String)hosts.get(host);
       if (key != null)
       return key;
       else
       return "get the key for your domain at http://www.google.com/apis/maps/signup.html";
      
       }
      
       //FIXME testweise hinzugefügt
       public Bean() {
       // TODO Auto-generated constructor stub
       }
      
      
      
       public void setGmapkey(String gmapkey) {
       this.gmapkey = gmapkey;
       }
      
      }
      


      Place.java
      package org.richfaces.demo.gmap;
      
      public class Place {
       private String pic;
       private String id;
       private String lat;
       private String lng;
       private int zoom;
       private String desc;
      
      
       public String getDesc() {
       return desc;
       }
       public void setDesc(String desc) {
       this.desc = desc;
       }
       public Place(String id, String pic, String lat, String lng, int zoom, String desc) {
       super();
       this.id = id;
       this.pic = pic;
       this.lat = lat;
       this.lng = lng;
       this.zoom = zoom;
       this.desc = desc;
       }
       public String getId() {
       return id;
       }
       public void setId(String id) {
       this.id = id;
       }
       public String getLat() {
       return lat;
       }
       public void setLat(String lat) {
       this.lat = lat;
       }
       public String getLng() {
       return lng;
       }
       public void setLng(String lng) {
       this.lng = lng;
       }
       public int getZoom() {
       return zoom;
       }
       public void setZoom(int zoom) {
       this.zoom = zoom;
       }
       public String getPic() {
       return pic;
       }
       public void setPic(String pic) {
       this.pic = pic;
       }
      }