You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Martin Marinschek <ma...@gmail.com> on 2006/02/08 09:17:20 UTC

Re: svn commit: r375880 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Thanks Dennis,

that's a very good one!

(sigh of relief)

regards,

Martin

On 2/8/06, dennisbyrne@apache.org <de...@apache.org> wrote:
> Author: dennisbyrne
> Date: Tue Feb  7 23:27:18 2006
> New Revision: 375880
>
> URL: http://svn.apache.org/viewcvs?rev=375880&view=rev
> Log:
> Things to reduce mailing list traffic
>
> Modified:
>     myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
>
> Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
> URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=375880&r1=375879&r2=375880&view=diff
> ==============================================================================
> --- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java (original)
> +++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java Tue Feb  7 23:27:18 2006
> @@ -79,6 +79,7 @@
>      private static final String DEFAULT_FACES_CONTEXT_FACTORY = FacesContextFactoryImpl.class.getName();
>      private static final String DEFAULT_LIFECYCLE_FACTORY = LifecycleFactoryImpl.class.getName();
>      private static final String DEFAULT_RENDER_KIT_FACTORY = RenderKitFactoryImpl.class.getName();
> +    private static final String DEFAULT_FACES_CONFIG = "/WEB-INF/faces-config.xml";
>
>      private static final Set FACTORY_NAMES  = new HashSet();
>      {
> @@ -361,6 +362,13 @@
>              while (st.hasMoreTokens())
>              {
>                  String systemId = st.nextToken().trim();
> +
> +                if(log.isWarnEnabled() && DEFAULT_FACES_CONFIG.equals(systemId))
> +                    log.warn(DEFAULT_FACES_CONFIG + " has been specified in the " +
> +                            FacesServlet.CONFIG_FILES_ATTR + " context parameter of " +
> +                            "the deployment descriptor. This should be removed, " +
> +                            "as it will be loaded twice.  See JSF spec 1.1, 10.3.2");
> +
>                  InputStream stream = _externalContext.getResourceAsStream(systemId);
>                  if (stream == null)
>                  {
> @@ -379,12 +387,11 @@
>      private void feedWebAppConfig() throws IOException, SAXException
>      {
>          //web application config
> -        String systemId = "/WEB-INF/faces-config.xml";
> -        InputStream stream = _externalContext.getResourceAsStream(systemId);
> +        InputStream stream = _externalContext.getResourceAsStream(DEFAULT_FACES_CONFIG);
>          if (stream != null)
>          {
>              if (log.isInfoEnabled()) log.info("Reading config /WEB-INF/faces-config.xml");
> -            _dispenser.feed(_unmarshaller.getFacesConfig(stream, systemId));
> +            _dispenser.feed(_unmarshaller.getFacesConfig(stream, DEFAULT_FACES_CONFIG));
>              stream.close();
>          }
>      }
> @@ -558,6 +565,11 @@
>          for (Iterator iterator = _dispenser.getManagedBeans(); iterator.hasNext();)
>          {
>              ManagedBean bean = (ManagedBean) iterator.next();
> +
> +            if(log.isWarnEnabled() && runtimeConfig.getManagedBean(bean.getManagedBeanName()) != null)
> +                log.warn("More than one managed bean w/ the name of '"
> +                        + bean.getManagedBeanName() + "' - only keeping the last ");
> +
>              runtimeConfig.addManagedBean(bean.getManagedBeanName(), bean);
>
>          }
>
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces