Look in the tapestry source file tapestry.request.xml

It shows how to inject both a WebRequest into another service, and how to
inject HttpServletRequest into another service.

Here's an example right out of the tapestry.request.xml file.

  <service-point id="RequestLocaleManager">
    
    Encapsulates the logic for extracting the locale for the current
request.
    
    <invoke-factory model="pooled">
      <construct class="impl.RequestLocaleManagerImpl">
        <set-service property="request"
service-id="tapestry.globals.WebRequest"/>
        <set-object property="cookieSource"
value="infrastructure:cookieSource"/>
        <set-service property="threadLocale"
service-id="hivemind.ThreadLocale"/>
        <set-object property="acceptedLocales"
value="app-property:org.apache.tapestry.accepted-locales"/>
      </construct>
    </invoke-factory>
  </service-point>   

-----Original Message-----
From: Chris Chiappone [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 01, 2005 11:51 AM
To: Tapestry List
Subject: Re: Replacing Deprecated methods

Ok I've just figured out how to contribute myService to hivemind and
inject it into my component, so the only other deprecated method I
have left is getRequestContext(), I don't belive I can inject a
WebRequest here since it extends the BaseEngine, so the question is
how to get the webRequest?


On 11/1/05, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> I've successfully upgraded my tap3 app consisting of ~40 pages, and
> removed all but two deprecated class/methods from it.
>
> The two that I am not sure of how to replace are
> cycle.getEngine().getService("MyService");  which I noticed the the
> workbench application also continues to use.  And I subclass
> BaseEngine cleanupAfterRequest to invalidate the session.  In that
> methed I use cycle.getRequestContext() which has been deprecated, and
> I'm not sure of the replacement.
>
> Other than that I recommed upgrading for those who are looking into
> it, it actually isn't as bad as I expected.
>
> --
> ~chris
>


--
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to