cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/mock/wml Mock.application

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/mock/wml Mock.application

hlship
hlship      2005/05/09 16:28:15

  Modified:    framework/src/java/org/apache/tapestry/error
                        StaleSessionExceptionPresenter.java
                        ExceptionPresenterImpl.java
               framework/src/descriptor/META-INF tapestry.error.xml
               framework/src/java/org/apache/tapestry
                        TapestryConstants.java
               framework/src/java/org/apache/tapestry/engine
                        AbstractEngine.java
               framework/src/java/org/apache/tapestry/services/impl
                        InfrastructureImpl.java
               framework/src/java/org/apache/tapestry/wml WMLEngine.java
               framework/src/java/org/apache/tapestry/services
                        Infrastructure.java
               portlet/src/descriptor/META-INF hivemodule.xml
               framework/src/test/org/apache/tapestry/junit/mock/wml
                        Mock.application
  Added:       framework/src/java/org/apache/tapestry/error
                        StaleLinkExceptionPresenterImpl.java
                        StaleLinkExceptionPresenter.java
               portlet/src/java/org/apache/tapestry/portlet
                        PortletStaleLinkExceptionPresenter.java
  Log:
  Split out reporting of stale link exceptions into its own service.
 
  Revision  Changes    Path
  1.2       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/error/StaleSessionExceptionPresenter.java
 
  Index: StaleSessionExceptionPresenter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/error/StaleSessionExceptionPresenter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StaleSessionExceptionPresenter.java 9 May 2005 20:43:02 -0000 1.1
  +++ StaleSessionExceptionPresenter.java 9 May 2005 23:28:15 -0000 1.2
  @@ -33,5 +33,5 @@
        * @param cause
        *            the exception that was caught
        */
  -    public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException ex);
  +    public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause);
   }
 
 
 
  1.4       +15 -0     jakarta-tapestry/framework/src/java/org/apache/tapestry/error/ExceptionPresenterImpl.java
 
  Index: ExceptionPresenterImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/error/ExceptionPresenterImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExceptionPresenterImpl.java 18 Apr 2005 17:06:41 -0000 1.3
  +++ ExceptionPresenterImpl.java 9 May 2005 23:28:15 -0000 1.4
  @@ -31,6 +31,8 @@
   
       private String _exceptionPageName;
   
  +    private boolean _verbose;
  +
       public void presentException(IRequestCycle cycle, Throwable cause)
       {
           try
  @@ -62,6 +64,9 @@
               throw new ApplicationRuntimeException(ex.getMessage(), ex);
           }
   
  +        if (_verbose)
  +            _requestExceptionReporter.reportRequestException(ErrorMessages
  +                    .unableToProcessClientRequest(cause), cause);
       }
   
       public void setExceptionPageName(String exceptionPageName)
  @@ -78,4 +83,14 @@
       {
           _responseRenderer = responseRenderer;
       }
  +
  +    public boolean isVerbose()
  +    {
  +        return _verbose;
  +    }
  +
  +    public void setVerbose(boolean verbose)
  +    {
  +        _verbose = verbose;
  +    }
   }
  \ No newline at end of file
 
 
 
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/error/StaleLinkExceptionPresenterImpl.java
 
  Index: StaleLinkExceptionPresenterImpl.java
  ===================================================================
  // Copyright 2005 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.tapestry.error;
 
  import org.apache.hivemind.ApplicationRuntimeException;
  import org.apache.tapestry.IPage;
  import org.apache.tapestry.IRequestCycle;
  import org.apache.tapestry.StaleLinkException;
  import org.apache.tapestry.services.ResponseRenderer;
 
  /**
   * Implementation of {@link org.apache.tapestry.error.StaleLinkExceptionPresenter} that uses a page
   * to present the exception. The page must implement a property named "message" of type String and
   * should present that message to the user.
   *
   * @author Howard M. Lewis Ship
   * @since 4.0
   */
  public class StaleLinkExceptionPresenterImpl implements StaleLinkExceptionPresenter
  {
      private RequestExceptionReporter _requestExceptionReporter;
 
      private ResponseRenderer _responseRenderer;
 
      private String _pageName;
 
      public void presentStaleLinkException(IRequestCycle cycle, StaleLinkException cause)
      {
          try
          {
              IPage exceptionPage = cycle.getPage(_pageName);
 
              exceptionPage.setProperty("message", cause.getMessage());
 
              cycle.activate(exceptionPage);
 
              _responseRenderer.renderResponse(cycle);
          }
          catch (Throwable ex)
          {
              // Worst case scenario. The exception page itself is broken, leaving
              // us with no option but to write the cause to the output.
 
              _requestExceptionReporter.reportRequestException(ErrorMessages
                      .unableToProcessClientRequest(cause), cause);
 
              // Also, write the exception thrown when redendering the exception
              // page, so that can get fixed as well.
 
              _requestExceptionReporter.reportRequestException(ErrorMessages
                      .unableToPresentExceptionPage(ex), ex);
 
              // And throw the exception.
 
              throw new ApplicationRuntimeException(ex.getMessage(), ex);
          }
 
      }
 
      public void setPageName(String pageName)
      {
          _pageName = pageName;
      }
 
      public void setRequestExceptionReporter(RequestExceptionReporter requestExceptionReporter)
      {
          _requestExceptionReporter = requestExceptionReporter;
      }
 
      public void setResponseRenderer(ResponseRenderer responseRenderer)
      {
          _responseRenderer = responseRenderer;
      }
 
  }
 
 
 
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/error/StaleLinkExceptionPresenter.java
 
  Index: StaleLinkExceptionPresenter.java
  ===================================================================
  // Copyright 2005 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.tapestry.error;
 
  import org.apache.tapestry.IRequestCycle;
  import org.apache.tapestry.StaleLinkException;
  import org.apache.tapestry.StaleSessionException;
 
  /**
   * Service interface for informing the user about a {@link org.apache.tapestry.StaleLinkException}.
   *
   * @author Howard M. Lewis Ship
   * @since 4.0
   */
  public interface StaleLinkExceptionPresenter
  {
      /**
       * Reports the stale link exception.
       *
       * @param cycle
       *            the current request cycle
       * @param cause
       *            the exception that was caught
       */
      public void presentStaleLinkException(IRequestCycle cycle, StaleLinkException cause);
  }
 
 
 
  1.5       +45 -4     jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.error.xml
 
  Index: tapestry.error.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.error.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- tapestry.error.xml 9 May 2005 20:43:02 -0000 1.4
  +++ tapestry.error.xml 9 May 2005 23:28:15 -0000 1.5
  @@ -39,6 +39,27 @@
       
     </service-point>
     
  +  <service-point id="WMLExceptionPresenter" interface="ExceptionPresenter">
  +    
  +    Handler for uncaught exceptions inside the main request
  +    processing code path for WML application; the default implementation
  +    displays the exception page to report the
  +    exception but verbose reports (to the console) the root exception as well.
  +    
  +    <invoke-factory>
  +      <construct class="ExceptionPresenterImpl">
  +        <set property="verbose" value="true"/>
  +        <set-object property="exceptionPageName"
  +                       value="infrastructure:exceptionPageName"/>
  +        <set-object property="requestExceptionReporter"
  +                       value="infrastructure:requestExceptionReporter"/>
  +        <set-object property="responseRenderer"
  +                      value="infrastructure:responseRenderer"/>
  +      </construct>
  +    </invoke-factory>
  +    
  +  </service-point>  
  +  
     <service-point id="StaleSessionExceptionPresenter">
       
       Handler for StaleSessionExceptions, which indicate that
  @@ -57,10 +78,24 @@
       </invoke-factory>    
     </service-point>
     
  -  <contribution configuration-id="hivemind.FactoryDefaults">
  -    <default symbol="org.apache.tapestry.exception-page-name" value="Exception"/>
  -    <default symbol="org.apache.tapestry.stale-session-page-name" value="StaleSession"/>
  -  </contribution>
  +  <service-point id="StaleLinkExceptionPresenter">
  +    
  +    Handler for StaleSessionExceptions, which indicate that
  +    the session has expired between the time a link or form
  +    was rendered, and the time it was triggered in a new request.
  +    
  +    <invoke-factory>
  +      <construct class="StaleLinkExceptionPresenterImpl">
  +        <set-object property="pageName"
  +                       value="infrastructure:staleLinkPageName"/>
  +        <set-object property="requestExceptionReporter"
  +                       value="infrastructure:requestExceptionReporter"/>
  +        <set-object property="responseRenderer"
  +                      value="infrastructure:responseRenderer"/>
  +      </construct>
  +    </invoke-factory>    
  +  </service-point>  
  +  
     
     
     <service-point id="RequestExceptionReporter" interface="RequestExceptionReporter">
  @@ -82,9 +117,15 @@
       <property name="staleSessionPageName" value="StaleSession"/>
       <property name="staleSessionPageName" mode="wml" value="WMLStaleSession"/>
       
  +    <property name="staleLinkPageName" value="StaleLink"/>
  +    <property name="staleLinkPageName" mode="wml" value="WMLStaleLink"/>
  +    
       <property name="requestExceptionReporter" object="service:RequestExceptionReporter"/>    
       <property name="exceptionPresenter" object="service:ExceptionPresenter"/>
  +    <property name="exceptionPresenter" mode="wml" object="service:WMLExceptionPresenter"/>
  +    
       <property name="staleSessionExceptionPresenter" object="service:StaleSessionExceptionPresenter"/>
  +    <property name="staleLinkExceptionPresenter" object="service:StaleLinkExceptionPresenter"/>
     </contribution>  
     
   </module>
  \ No newline at end of file
 
 
 
  1.6       +0 -35     jakarta-tapestry/framework/src/java/org/apache/tapestry/TapestryConstants.java
 
  Index: TapestryConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/TapestryConstants.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TapestryConstants.java 18 Apr 2005 17:06:42 -0000 1.5
  +++ TapestryConstants.java 9 May 2005 23:28:15 -0000 1.6
  @@ -21,41 +21,6 @@
   public class TapestryConstants
   {
       /**
  -     * The name ("Home") of the default page presented when a user first accesses the application.
  -     *
  -     * @see org.apache.tapestry.engine.HomeService
  -     * @deprecated To be removed in 4.1.
  -     */
  -
  -    public static final String HOME_PAGE = "Home";
  -
  -    /**
  -     * The name ("Exception") of the page used for reporting exceptions.
  -     * <p>
  -     * Such a page must have a writable JavaBeans property named 'exception' of type
  -     * <code>java.lang.Throwable</code>.
  -     *
  -     * @deprecated To be removed in 4.1.
  -     */
  -
  -    public static final String EXCEPTION_PAGE = "Exception";
  -
  -    /**
  -     * The name ("StaleLink") of the page used for reporting stale links.
  -     * <p>
  -     * The page must implement a writeable JavaBeans proeprty named 'message' of type
  -     * <code>String</code>.
  -     */
  -
  -    public static final String STALE_LINK_PAGE = "StaleLink";
  -
  -    /**
  -     * The name ("StaleSession") of the page used for reporting state sessions.
  -     */
  -
  -    public static final String STALE_SESSION_PAGE = "StaleSession";
  -
  -    /**
        * Name of the cookie written to the client web browser to identify the locale.
        */
   
 
 
 
  1.1                  jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletStaleLinkExceptionPresenter.java
 
  Index: PortletStaleLinkExceptionPresenter.java
  ===================================================================
  // Copyright 2005 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.tapestry.portlet;
 
  import javax.portlet.ActionRequest;
  import javax.portlet.ActionResponse;
 
  import org.apache.hivemind.ApplicationRuntimeException;
  import org.apache.tapestry.IRequestCycle;
  import org.apache.tapestry.StaleLinkException;
  import org.apache.tapestry.error.RequestExceptionReporter;
  import org.apache.tapestry.error.StaleLinkExceptionPresenter;
  import org.apache.tapestry.services.ServiceConstants;
 
  /**
   * Implementation of {@link org.apache.tapestry.error.StaleLinkExceptionPresenter} for Portlets.
   *
   * @author Howard M. Lewis Ship
   * @since 4.0
   */
  public class PortletStaleLinkExceptionPresenter implements StaleLinkExceptionPresenter
  {
      private PortletRequestGlobals _globals;
 
      private RequestExceptionReporter _requestExceptionReporter;
 
      public void presentStaleLinkException(IRequestCycle cycle, StaleLinkException cause)
      {
          try
          {
              ActionRequest request = _globals.getActionRequest();
 
              request.getPortletSession(true).setAttribute(
                      PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
                      cause.getMessage());
 
              ActionResponse response = _globals.getActionResponse();
 
              response.setRenderParameter(
                      ServiceConstants.SERVICE,
                      PortletConstants.EXCEPTION_SERVICE);
          }
          catch (Exception ex)
          {
              // Worst case scenario. The exception page itself is broken, leaving
              // us with no option but to write the cause to the output.
 
              // Also, write the exception thrown when redendering the exception
              // page, so that can get fixed as well.
 
              _requestExceptionReporter.reportRequestException(PortletMessages
                      .errorReportingException(ex), ex);
 
              // And throw the exception.
 
              throw new ApplicationRuntimeException(ex.getMessage(), ex);
          }
      }
 
      public void setGlobals(PortletRequestGlobals globals)
      {
          _globals = globals;
      }
 
      public void setRequestExceptionReporter(RequestExceptionReporter requestExceptionReporter)
      {
          _requestExceptionReporter = requestExceptionReporter;
      }
 
  }
 
 
 
  1.33      +31 -38    jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/AbstractEngine.java
 
  Index: AbstractEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/AbstractEngine.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- AbstractEngine.java 9 May 2005 20:43:02 -0000 1.32
  +++ AbstractEngine.java 9 May 2005 23:28:15 -0000 1.33
  @@ -289,9 +289,9 @@
       }
   
       /**
  -     * Handles {@link PageRedirectException}&nbsp;which involves executing
  -     * {@link IPage#validate(IRequestCycle)}on the target page (of the exception), until either a
  -     * loop is found, or a page succesfully validates and can be activated.
  +     * Handles {@link PageRedirectException} which involves executing
  +     * {@link IRequestCycle#activate(IPage)} on the target page (of the exception), until either a
  +     * loop is found, or a page succesfully activates.
        * <p>
        * This should generally not be overriden in subclasses.
        *
  @@ -299,7 +299,7 @@
        */
   
       protected void handlePageRedirectException(IRequestCycle cycle, PageRedirectException exception)
  -            throws IOException, ServletException
  +            throws IOException
       {
           List pageNames = new ArrayList();
   
  @@ -326,9 +326,9 @@
   
                   break;
               }
  -            catch (PageRedirectException ex2)
  +            catch (PageRedirectException secondRedirectException)
               {
  -                pageName = ex2.getTargetPageName();
  +                pageName = secondRedirectException.getTargetPageName();
               }
           }
   
  @@ -336,19 +336,22 @@
       }
   
       /**
  -     * Invoked by {@link #service(RequestContext)}if a {@link StaleLinkException}is thrown by the
  -     * {@link IEngineService service}. This implementation sets the message property of the
  -     * StaleLink page to the message provided in the exception, then invokes
  -     * {@link #redirect(String, IRequestCycle, ApplicationRuntimeException)}to render the StaleLink
  +     * Invoked by {@link #service(WebRequest, WebResponse)} if a {@link StaleLinkException} is
  +     * thrown by the {@link IEngineService service}. This implementation sets the message property
  +     * of the StaleLink page to the message provided in the exception, then invokes
  +     * {@link #redirect(String, IRequestCycle, ApplicationRuntimeException)} to render the StaleLink
        * page.
        * <p>
  -     * Subclasses may overide this method (without invoking this implementation). A common practice
  -     * is to present an error message on the application's Home page.
  +     * Subclasses may overide this method (without invoking this implementation). A better practice
  +     * is to contribute an alternative implementation of
  +     * {@link org.apache.tapestry.error.StaleLinkExceptionPresenter} to the
  +     * tapestry.InfrastructureOverrides configuration point.
        * <p>
  -     * Alternately, the application may provide its own version of the StaleLink page, overriding
  -     * the framework's implementation (probably a good idea, because the default page hints at
  -     * "application errors" and isn't localized). The overriding StaleLink implementation must
  -     * implement a message property of type String.
  +     * A common practice is to present an error message on the application's Home page. Alternately,
  +     * the application may provide its own version of the StaleLink page, overriding the framework's
  +     * implementation (probably a good idea, because the default page hints at "application errors"
  +     * and isn't localized). The overriding StaleLink implementation must implement a message
  +     * property of type String.
        *
        * @since 0.2.10
        */
  @@ -356,22 +359,19 @@
       protected void handleStaleLinkException(IRequestCycle cycle, StaleLinkException exception)
               throws IOException
       {
  -        String staleLinkPageName = getStaleLinkPageName();
  -        IPage page = cycle.getPage(staleLinkPageName);
  -
  -        page.setProperty("message", exception.getMessage());
  -
  -        redirect(staleLinkPageName, cycle, exception);
  +        _infrastructure.getStaleLinkExceptionPresenter()
  +                .presentStaleLinkException(cycle, exception);
       }
   
       /**
  -     * Invoked by {@link #service(RequestContext)}if a {@link StaleSessionException}is thrown by
  -     * the {@link IEngineService service}. This implementation invokes
  -     * {@link #redirect(String, IRequestCycle, ApplicationRuntimeException)}to render the
  -     * StaleSession page.
  +     * Invoked by {@link #service(WebRequest, WebResponse)} if a {@link StaleSessionException} is
  +     * thrown by the {@link IEngineService service}. This implementation uses the
  +     * {@link org.apache.tapestry.error.StaleSessionExceptionPresenter} to render the StaleSession
  +     * page.
        * <p>
  -     * Subclasses may overide this method (without invoking this implementation). A common practice
  -     * is to present an eror message on the application's Home page.
  +     * Subclasses may overide this method (without invoking this implementation), but it is better
  +     * to override the tapestry.error.StaleSessionExceptionReporter service instead (or contribute a
  +     * replacement to the tapestry.InfrastructureOverrides configuration point).
        *
        * @since 0.2.10
        */
  @@ -495,7 +495,7 @@
       }
   
       /**
  -     * Invoked when a {@link RedirectException}is thrown during the processing of a request.
  +     * Invoked when a {@link RedirectException} is thrown during the processing of a request.
        *
        * @throws ApplicationRuntimeException
        *             if an {@link IOException},{@link ServletException}is thrown by the redirect,
  @@ -503,9 +503,9 @@
        * @since 2.2
        */
   
  -    protected void handleRedirectException(IRequestCycle cycle, RedirectException ex)
  +    protected void handleRedirectException(IRequestCycle cycle, RedirectException redirectException)
       {
  -        String location = ex.getRedirectLocation();
  +        String location = redirectException.getRedirectLocation();
   
           if (LOG.isDebugEnabled())
               LOG.debug("Redirecting to: " + location);
  @@ -529,13 +529,6 @@
           return _infrastructure.getApplicationPropertySource();
       }
   
  -    /** @since 3.0 */
  -
  -    protected String getStaleLinkPageName()
  -    {
  -        return TapestryConstants.STALE_LINK_PAGE;
  -    }
  -
       /** @since 4.0 */
       public Infrastructure getInfrastructure()
       {
 
 
 
  1.31      +6 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/services/impl/InfrastructureImpl.java
 
  Index: InfrastructureImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/services/impl/InfrastructureImpl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- InfrastructureImpl.java 9 May 2005 20:43:02 -0000 1.30
  +++ InfrastructureImpl.java 9 May 2005 23:28:15 -0000 1.31
  @@ -34,6 +34,7 @@
   import org.apache.tapestry.engine.state.ApplicationStateManager;
   import org.apache.tapestry.error.ExceptionPresenter;
   import org.apache.tapestry.error.RequestExceptionReporter;
  +import org.apache.tapestry.error.StaleLinkExceptionPresenter;
   import org.apache.tapestry.error.StaleSessionExceptionPresenter;
   import org.apache.tapestry.listener.ListenerMapSource;
   import org.apache.tapestry.markup.MarkupWriterSource;
  @@ -242,6 +243,11 @@
           return (StaleSessionExceptionPresenter) getProperty("staleSessionExceptionPresenter");
       }
   
  +    public StaleLinkExceptionPresenter getStaleLinkExceptionPresenter()
  +    {
  +        return (StaleLinkExceptionPresenter) getProperty("staleLinkExceptionPresenter");
  +    }
  +
       public Object getProperty(String propertyName)
       {
           Defense.notNull(propertyName, "propertyName");
 
 
 
  1.8       +4 -49     jakarta-tapestry/framework/src/java/org/apache/tapestry/wml/WMLEngine.java
 
  Index: WMLEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/wml/WMLEngine.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WMLEngine.java 3 Apr 2005 14:50:00 -0000 1.7
  +++ WMLEngine.java 9 May 2005 23:28:15 -0000 1.8
  @@ -14,64 +14,19 @@
   
   package org.apache.tapestry.wml;
   
  -import org.apache.tapestry.IRequestCycle;
  -import org.apache.tapestry.Tapestry;
   import org.apache.tapestry.engine.BaseEngine;
  -import org.apache.tapestry.error.ErrorMessages;
   
   /**
  - * Subclass of {@link BaseEngine}used for WML applications to change the Exception, StaleLink and
  + * Subclass of {@link BaseEngine} used for WML applications to change the Exception, StaleLink and
    * StaleSession pages.
    *
    * @author David Solis
    * @since 3.0
  + * @deprecated To be removed in 4.1. No longer necessary; the differences between WML applications
  + *             and HTML applications are now handled via a startup mode. See
  + *             {@link org.apache.tapestry.services.impl.SetupServletApplicationGlobals}.
    */
   
   public class WMLEngine extends BaseEngine
   {
  -    protected void activateExceptionPage(IRequestCycle cycle, Throwable cause)
  -    {
  -        super.activateExceptionPage(cycle, cause);
  -
  -        // Sometimes the exception page isn't enough
  -        reportException(ErrorMessages.unableToProcessClientRequest(cause), cause);
  -    }
  -
  -    /** @since 3.0 * */
  -
  -    protected String getExceptionPageName()
  -    {
  -        return EXCEPTION_PAGE;
  -    }
  -
  -    /** @since 3.0 * */
  -
  -    protected String getStaleLinkPageName()
  -    {
  -        return STALE_LINK_PAGE;
  -    }
  -
  -    /** @since 3.0 * */
  -
  -    protected String getStaleSessionPageName()
  -    {
  -        return STALE_SESSION_PAGE;
  -    }
  -
  -    /**
  -     * The name of the page used for reporting exceptions.
  -     */
  -    private static final String EXCEPTION_PAGE = "WMLException";
  -
  -    /**
  -     * The name of the page used for reporting stale links.
  -     */
  -
  -    private static final String STALE_LINK_PAGE = "WMLStaleLink";
  -
  -    /**
  -     * The name of the page used for reporting state sessions.
  -     */
  -
  -    private static final String STALE_SESSION_PAGE = "WMLStaleSession";
   }
  \ No newline at end of file
 
 
 
  1.32      +7 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/services/Infrastructure.java
 
  Index: Infrastructure.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/services/Infrastructure.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Infrastructure.java 9 May 2005 20:43:02 -0000 1.31
  +++ Infrastructure.java 9 May 2005 23:28:15 -0000 1.32
  @@ -26,6 +26,7 @@
   import org.apache.tapestry.engine.state.ApplicationStateManager;
   import org.apache.tapestry.error.ExceptionPresenter;
   import org.apache.tapestry.error.RequestExceptionReporter;
  +import org.apache.tapestry.error.StaleLinkExceptionPresenter;
   import org.apache.tapestry.error.StaleSessionExceptionPresenter;
   import org.apache.tapestry.listener.ListenerMapSource;
   import org.apache.tapestry.markup.MarkupWriterSource;
  @@ -251,4 +252,10 @@
        */
   
       public StaleSessionExceptionPresenter getStaleSessionExceptionPresenter();
  +
  +    /**
  +     * The service responsible for reporting {@link org.apache.tapestry.StaleLinkException}s.
  +     */
  +
  +    public StaleLinkExceptionPresenter getStaleLinkExceptionPresenter();
   }
  \ No newline at end of file
 
 
 
  1.14      +17 -1     jakarta-tapestry/portlet/src/descriptor/META-INF/hivemodule.xml
 
  Index: hivemodule.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/portlet/src/descriptor/META-INF/hivemodule.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- hivemodule.xml 9 May 2005 20:43:03 -0000 1.13
  +++ hivemodule.xml 9 May 2005 23:28:15 -0000 1.14
  @@ -209,7 +209,9 @@
     <contribution configuration-id="tapestry.Infrastructure">
       <property name="linkFactory" mode="portlet" object="service:PortletLinkFactory"/>
       <property name="HTMLDescriber" mode="portlet" object="service:PortletHTMLDescriber"/>
  -    <property name="exceptionPresenter" mode="portlet" object="service:PortletExceptionPresenter" />
  +    <property name="exceptionPresenter" mode="portlet" object="service:PortletExceptionPresenter"/>
  +    <property name="staleLinkExceptionPresenter" mode="portlet" object="service:PortletStaleLinkExceptionPresenter"/>
  +    <property name="staleSessionExceptionPresenter" mode="portlet" object="service:PortletStaleSessionExceptionPresenter"/>
     </contribution>
     
    <contribution configuration-id="PortletApplicationInitializers">
  @@ -264,6 +266,20 @@
       
     </service-point>
     
  +  <service-point id="PortletStaleLinkExceptionPresenter" interface="org.apache.tapestry.error.StaleLinkExceptionPresenter">
  +    
  +    Displays the stale link exception's message.
  +    
  +    <invoke-factory>
  +      <construct class="PortletStaleLinkExceptionPresenter">
  +        <set-service property="globals" service-id="PortletRequestGlobals"/>
  +        <set-object property="requestExceptionReporter"
  +                       value="infrastructure:requestExceptionReporter"/>  
  +      </construct>
  +    </invoke-factory>
  +    
  +  </service-point>  
  +  
    <contribution configuration-id="tapestry.describe.DescribableStrategies">
       <strategy class="javax.portlet.PortletSession" object="instance:PortletSessionDescribableStrategy"/>
       <strategy class="javax.portlet.PortletConfig" object="instance:PortletConfigStrategy"/>
 
 
 
  1.5       +1 -3      jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/mock/wml/Mock.application
 
  Index: Mock.application
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/mock/wml/Mock.application,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Mock.application 18 Apr 2005 17:07:54 -0000 1.4
  +++ Mock.application 9 May 2005 23:28:15 -0000 1.5
  @@ -19,9 +19,7 @@
     "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
     "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
   
  -<application name="JUnit Mock WML Application" engine-class="org.apache.tapestry.wml.WMLEngine">
  -
  -    <meta key="org.apache.tapestry.exception-page-name" value="WMLException"/>
  +<application name="JUnit Mock WML Application">
   
       <meta key="org.apache.tapestry.template-extension" value="wml"/>
   
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]