Cool :)
Thanks a lot, it works for me too :)
It seems that the documentation is poor or I am not
searching at the right place..?
--- Bryan Lewis <[EMAIL PROTECTED]> wrote:
> I believe the reason the WebRequestServicerFilter
> was suggested was to
> avoid that inelegant bit. This worked for me:
>
> <service-point id="WebRequestFilter"
>
interface="org.apache.tapestry.services.WebRequestServicerFilter">
> <invoke-factory>
> <construct
> class="cview.services.WebRequestFilter">
> <set-object property="appStateManager"
> value="infrastructure:applicationStateManager"/>
> </construct>
> </invoke-factory>
> </service-point>
>
> <contribution
>
configuration-id="tapestry.request.WebRequestServicerPipeline">
> <filter name="WebRequestFilter"
> object="service:WebRequestFilter" />
> </contribution>
>
> public class WebRequestFilter implements
> WebRequestServicerFilter {
> private ApplicationStateManager appStateManager;
> public void
> setAppStateManager(ApplicationStateManager asm) {
> appStateManager = asm;
> }
>
> public void service(....) {
> servicer.service(request, response);
> System.out.println("visit = " + (Visit)
> appStateManager.get("visit"));
> }
> }
>
>
> Dobrin Ivanov wrote:
> > Thanks, now it works. My filter is :
> > -----------------------------------------
> > public void service(WebRequest request,
> WebResponse
> > response, WebRequestServicer servicer) throws
> > IOException {
> > // Request Cycle Begin
> > servicer.service(request, response);
> > // Request Cycle End
> > WebSession webSession =
> request.getSession(false);
> > if (webSession!=null) {
> > String visitKey = "state:" + APP_NAME +
> ":visit";
> > Visit visit = (Visit)
> > webSession.getAttribute(visitKey);
> > // use visit
> > }
> > }
> > -----------------------------------------
> >
> > So, we again have this visit-from-session code,
> but
> > the only inelegant bit is this visitKey assembling
> > part may be :)
> >
> > --- James Carman <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >> Sorry. Try
> >> tapestry.request.WebRequestServicerPipeline. As
> I
> >> said, it was
> >> off the top of my head. Sorry for the typo.
> >>
> >> -----Original Message-----
> >> From: Dobrin Ivanov
> >> [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, September 22, 2006 1:45 PM
> >> To: Tapestry users
> >> Subject: RE: How to listent for the Request Cycle
> >> End
> >>
> >> 10x
> >>
> >> Now i get the error below. Any chance that there
> are
> >> some docs for this?
> >>
> >> 1547 [main] ERROR
> >>
> >>
> >
>
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/weprom]
> >
> >> - Servlet /weprom threw load() exception
> >> org.apache.hivemind.ApplicationRuntimeException:
> >> Error
> >> at context:/WEB-INF/hivemodule.xml, line 19,
> column
> >> 79: Module weprom has contributed to unknown con
> >> figuration point
> >> hivemind.request.WebRequestServicerPipeline. The
> >> contribution has been ignored.
> >> [context:/WEB-INF/hivemodule.xml, line 19, column
> >> 79]
> >> at
> >>
> >>
> >
>
org.apache.hivemind.impl.StrictErrorHandler.error(StrictErrorHandler.java:39
> >
> >> )
> >>
> >> --- James Carman <[EMAIL PROTECTED]>
> wrote:
> >>
> >>
> >>> You can put it in your WEB-INF folder or in
> >>> WEB-INF/classes/META-INF.
> >>> Tapestry (actually HiveMind) will find it in
> >>>
> >> either
> >>
> >>> case.
> >>>
> >>> -----Original Message-----
> >>> From: Dobrin Ivanov
> >>> [mailto:[EMAIL PROTECTED]
> >>> Sent: Friday, September 22, 2006 1:26 PM
> >>> To: Tapestry users
> >>> Subject: RE: How to listent for the Request
> Cycle
> >>> End
> >>>
> >>> And where should be located my hivemodule.xml?
> >>>
> >> (I'm
> >>
> >>> using just Tapestry, I know it lies above
> hivemind
> >>> microkernel...)
> >>>
> >>>
> >>> --- James Carman <[EMAIL PROTECTED]>
> >>>
> >> wrote:
> >>
> >>>> To plug into the WebRequestServicerPipeline,
> you
> >>>> implement the
> >>>> WebRequestServicerFilter interface:
> >>>>
> >>>> public class MyFilter implements
> >>>> WebRequestServicerFilter
> >>>> {
> >>>> }
> >>>>
> >>>> Then, in your hivemodule.xml you plug it into
> >>>>
> >> the
> >>
> >>>> pipeline:
> >>>>
> >>>> <contribution
> >>>>
> >>>>
> >
>
configuration-id="hivemind.request.WebRequestServicerPipeline">
> >
> >>>> <filter name="MyFilter"
> >>>>
> >>> object="instance:MyFilter"
> >>>
> >>>> />
> >>>> </contribution>
> >>>>
> >>>> That's off the top of my head, but you get the
> >>>>
> >>> idea.
> >>>
> >>>> This basically acts
> >>>> like a servlet filter, but you can plug
> >>>> hivemind-managed filters in (so you
> >>>> can inject stuff into your implementation
> >>>>
> >>> objects).
> >>>
> >>>> -----Original Message-----
> >>>> From: Dobrin Ivanov
> >>>> [mailto:[EMAIL PROTECTED]
> >>>> Sent: Wednesday, September 20, 2006 1:30 PM
> >>>> To: Tapestry users
> >>>> Subject: Re: How to listent for the Request
> >>>>
> >> Cycle
> >>
> >>>> End
> >>>>
> >>>> I do not know about this custom Engine classes
> >>>> changes
> >>>> (frowned)...
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]