myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "A Little Quality Assurance" by Dennis Byrne
Date Sun, 02 Apr 2006 20:30:35 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by Dennis Byrne:
http://wiki.apache.org/myfaces/A_Little_Quality_Assurance

New page:
= JSF Configuration Validation =

Our JSF configuration files can grow a bit unruly on large projects.  MyFaces provides a feature
allowing for some easy cleanup.

Let's say we have the following in our deployment descriptor:

{{{
  <navigation-rule> 
    <from-view-id>/missing.jsp</from-view-id> 
    <navigation-case> 
      <from-action>#{UserLister.load}</from-action>
      <from-outcome>SUCCESS</from-outcome> 
      <to-view-id>/doesNotExist.jsp</to-view-id>
    </navigation-case> 
  </navigation-rule>

  <managed-bean>
        <managed-bean-name>missing</managed-bean-name>
        <managed-bean-class>org.apache.myfaces.Missing</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>
}}}

It appears an application developer has configured a navition rule for two non-existing JSPs,
and a managed bean that is not in the classpath.

We discover this after we place the following context parameter in the deployment descriptor.

{{{
   <context-param>
       <param-name>org.apache.myfaces.validate</param-name>
       <param-value>true</param-value>
   </context-param>
}}}

At startup, we find the following in our logs/console:

{{{
WARN  org.apache.myfaces.webapp.StartupServletContextListener - File for navigation 'from
id' does not exist D:\jakarta-tomcat-5.5.9\webapps\demo\/missing.jsp

WARN  org.apache.myfaces.webapp.StartupServletContextListener - File for navigation 'to id'
does not exist D:\jakarta-tomcat-5.5.9\webapps\demo\/doesNotExist.jsp

WARN  org.apache.myfaces.webapp.StartupServletContextListener - Could not locate class org.apache.myfaces.Missing
for managed bean 'missing'

INFO  org.apache.myfaces.webapp.StartupServletContextListener - ServletContext 'D:\jakarta-tomcat-5.5.9\webapps\demo\'
initialized.

}}}

Mime
View raw message