You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mi...@Sparkassen-Informatik.de on 2005/12/13 10:35:24 UTC

Re: Tapestry4 setupForRequest "replacement"? [Virus checked]

Hi,

i move the code from setupForRequest and cleanupAfterRequest
to a service implementing the interface
org.apache.tapestry.services.WebRequestServicerFilter
and contribute this service to the configuration-point

tapestry.request.WebRequestServicerPipeline

example:

     <service-point id="WorkflowRequestFilter"
interface="org.apache.tapestry.services.WebRequestServicerFilter">
        <invoke-factory>
              <construct
class="de.sparkasseninformatik.comserv.tapui.workflow.WorkflowRequestFilter">
                    <set-object property="applicationStateManager"
value="service:tapestry.state.ApplicationStateManager"/>
                    <set-object property="workflowEngine"
value="service:de.sparkasseninformatik.comserv.workflow.WorkflowEngine"/>

              </construct>
        </invoke-factory>
    </service-point>

    <contribution
configuration-id="tapestry.request.WebRequestServicerPipeline">
      <filter name="WorkflowRequestFilter"
object="service:WorkflowRequestFilter"/>
    </contribution>

inside the method 'service' you can thing like:

    public void service(WebRequest request, WebResponse response,
            WebRequestServicer servicer) throws IOException
    {
        _requestGlobals.store(request, response);

        try
        {
            before(request, response);
            servicer.service(request, response);
        }
        finally
        {
            after(request, response);
        }
    }

Mit freundlichen Grüßen

Michael Frericks


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Tapestry4 setupForRequest "replacement"? [Virus checked]

Posted by Ron Piterman <rp...@gmx.net>.
no no no... look at my fresh post in reply to this thread - there is a 
much better way of doing just what you want.


Michael.Frericks@Sparkassen-Informatik.de wrote:
> Hi,
> 
> i move the code from setupForRequest and cleanupAfterRequest
> to a service implementing the interface
> org.apache.tapestry.services.WebRequestServicerFilter
> and contribute this service to the configuration-point
> 
> tapestry.request.WebRequestServicerPipeline
> 
> example:
> 
>      <service-point id="WorkflowRequestFilter"
> interface="org.apache.tapestry, also because it is , also because it is .services.WebRequestServicerFilter">
>         <invoke-factory>
>               <construct
> class="de.sparkasseninformatik.comserv.tapui.workflow.WorkflowRequestFilter">
>                     <set-object property="applicationStateManager"
> value="service:tapestry.state.ApplicationStateManager"/>
>                     <set-object property="workflowEngine"
> value="service:de.sparkasseninformatik.comserv.workflow.WorkflowEngine"/>
> 
>               </construct>
>         </invoke-factory>
>     </service-point>
> 
>     <contribution
> configuration-id="tapestry.request.WebRequestServicerPipeline">
>       <filter name="WorkflowRequestFilter"
> object="service:WorkflowRequestFilter"/>
>     </contribution>
> 
> inside the method 'service' you can thing like:
> 
>     public void service(WebRequest request, WebResponse response,
>             WebRequestServicer servicer) throws IOException
>     {
>         _requestGlobals.store(request, response);
> 
>         try
>         {
>             before(request, response);
>             servicer.service(request, response);
>         }
>         finally
>         {
>             after(request, response);
>         }
>     }
> 
> Mit freundlichen Grüßen
> 
> Michael Frericks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org