Yeah it's a real blessing. Most of the time all I have to do is
quickly try to remember in my head if it's possible that there will be
more than one implementation of a service I want to inject..95% of the
time there isn't so no thought / looking up of service id's are
required...

Great work James, and thank you! ;)

On 2/11/07, James Carman <[EMAIL PROTECTED]> wrote:
No problem.  I think the property "injector" code works by enhancing
(extending) your page/component classes and implementing the
getter/setter methods.  But, it should complain that your
getters/setters aren't abstract, I would think (it does in other
cases).

The thing I like most about the tapestry-autowire stuff is that all
you have to do is drop the jar file into your WEB-INF/lib director and
it just works!  No configuration necessary.


On 2/11/07, Numa Schmeder <[EMAIL PROTECTED]> wrote:
> The autowire stuff is downloaded! Really great !!!!!
> Thanks a lot
>
> Muma
>
> Le 10 févr. 07 à 21:11, James Carman a écrit :
>
> > Have you tried tapestry-autowire
> > (http://svn.javaforge.com/svn/tapestry/tapestry-autowire/trunk)?  You
> > can check out the source code (anonymous/anon login) and build it
> > yourself since there hasn't been an official release.  Or, just
> > upgrade to 4.1 and it'll automatically inject HiveMind services into
> > your components/pages (because it has tapestry-autowire "baked in").
> >
> > On 2/9/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >> That's true, but then again I don't think Howard intended for the
> >> Registry to be publicly accessible in the first place:
> >>
> >> http://article.gmane.org/gmane.comp.java.tapestry.user/20207/
> >>
> >> The "proper" way is to use injection on .page and .jwc files or
> >> annotations, but this is obviously complicated in your situation
> >> since you can't use annotations and (understandably) don't want to
> >> have to inject the same service on to every single page. On the
> >> other hand there are some alternatives to getting Tapestry
> >> services other than using the Registry directly:
> >>
> >> http://article.gmane.org/gmane.comp.java.tapestry.user/21861/
> >>
> >> HTH
> >>
> >> Ben
> >>
> >> -----Original Message-----
> >> From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, February 09, 2007 1:54 PM
> >> To: Tapestry users
> >> Subject: Re: Migration to Tap4, accessing the hivemind registry
> >> without injection
> >>
> >> Thanks Ben,
> >>
> >> I am going to try, I find it a bit of hack.  And I find strange that
> >> there is no access to the registry.
> >>
> >> Thanks
> >>
> >> Numa
> >> Le 9 févr. 07 à 20:24, Ben Dotte a écrit :
> >>
> >> > I'm not sure if there is a more straightforward way, but one way is
> >> > to store the servlet into the request and then pull out the
> >> > ServletContext from that.
> >> >
> >> > So make a subclass of org.apache.tapestry.ApplicationServlet:
> >> > public class MyApplicationServlet extends ApplicationServlet
> >> > {
> >> >       protected void doService(HttpServletRequest request,
> >> > HttpServletResponse response) throws IOException, ServletException
> >> >       {
> >> >               request.setAttribute("servlet", this);
> >> >               super.doService(request, response);
> >> >       }
> >> > }
> >> >
> >> > Set it up in web.xml:
> >> > <servlet>
> >> >       <servlet-name>app</servlet-name>
> >> >       <servlet-class>path.to.MyApplicationServlet</servlet-class>
> >> >       <load-on-startup>1</load-on-startup>
> >> > </servlet>
> >> >
> >> > Then pull out the registry in your base page:
> >> > public Registry getRegistry()
> >> > {
> >> >       return (Registry) ((MyApplicationServlet) getRequestCycle
> >> > ().getInfrastructure().getRequest().getAttribute
> >> > ("servlet")).getServletContext().getAttribute
> >> > ("org.apache.tapestry.Registry:app");
> >> > }
> >> >
> >> > Ben
> >> >
> >> > -----Original Message-----
> >> > From: Numa Schmeder [mailto:[EMAIL PROTECTED]
> >> > Sent: Friday, February 09, 2007 1:08 PM
> >> > To: Tapestry users
> >> > Subject: Re: Migration to Tap4, accessing the hivemind registry
> >> > without injection
> >> >
> >> > I knew that, but I don't know how to access a context from a
> >> Page or
> >> > from the request cycle.
> >> > How can you get the servlet context?
> >> >
> >> > Thanks,
> >> >
> >> > Numa
> >> > Le 9 févr. 07 à 19:49, Shing Hing Man a écrit :
> >> >
> >> >> A singleton has the advantage of letting you access
> >> >> the registry in non-web pages.
> >> >> In case you did not know,
> >> >> the registry is created in the  ApplicationServlet and
> >> >> stored as a context parameter.
> >> >>
> >> >> // context is the servlet context
> >> >> Registry registry = (Registry) context
> >> >>
> >> >> .getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
> >> >>                                                 +
> >> >> "(the name of ApplicationServlet given in web.xml");
> >> >>
> >> >>
> >> >> Shing
> >> >>
> >> >>
> >> >> --- Numa Schmeder <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >>> Nop, but isn't an easier way to just access the
> >> >>> registry?
> >> >>>
> >> >>> Le 9 févr. 07 à 19:33, Shing Hing Man a écrit :
> >> >>>
> >> >>>> Have you considered implementing the HiveMind
> >> >>> registry
> >> >>>> as a singleton ?
> >> >>>>
> >> >>>> The zebra-hivemind subproject in Zebra does
> >> >>> exactly
> >> >>>> that.
> >> >>>> http://zebra.berlios.de/
> >> >>>>
> >> >>>> Shing
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> --- Numa Schmeder <[EMAIL PROTECTED]> wrote:
> >> >>>>
> >> >>>>> Hello,
> >> >>>>>
> >> >>>>> I am migrating an application from tap3 to tap4,
> >> >>> I
> >> >>>>> am hitting a lot
> >> >>>>> of problem.
> >> >>>>> One of those is getting a reference to the
> >> >>> hivemind
> >> >>>>> registry from
> >> >>>>> java without using injection.
> >> >>>>>
> >> >>>>> I have a base page who used to provide a
> >> >>> DAOFactory
> >> >>>>> to all my
> >> >>>>> subclassing pages, now the DAOFactory is in the
> >> >>>>> hivemind registry.
> >> >>>>> I don't want to go to each page specification to
> >> >>>>> inject the DAO
> >> >>>>> Factory and I can't use annotations.  So I would
> >> >>>>> like to access the
> >> >>>>> hivemind registry programmatically.
> >> >>>>> How can I do, I have checked many docs but
> >> >>> couldn't
> >> >>>>> find a clue.
> >> >>>>>
> >> >>>>> Could someone help me please!
> >> >>>>>
> >> >>>>> Thanks
> >> >>>>>
> >> >>>>> Numa
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>>
> >> >>
> >> ---------------------------------------------------------------------
> >> >>>>> To unsubscribe, e-mail:
> >> >>>>> [EMAIL PROTECTED]
> >> >>>>> For additional commands, e-mail:
> >> >>>>> [EMAIL PROTECTED]
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>>>
> >> >>>> Home page :
> >> >>>>   http://uk.geocities.com/matmsh/index.html
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >> ___________________________________________________________
> >> >>>> All New Yahoo! Mail - Tired of unwanted email
> >> >>> come-ons? Let our
> >> >>>> SpamGuard protect you.
> >> >>> http://uk.docs.yahoo.com/nowyoucan.html
> >> >>>>
> >> >>>>
> >> >>>
> >> >>
> >> ---------------------------------------------------------------------
> >> >>>> To unsubscribe, e-mail:
> >> >>> [EMAIL PROTECTED]
> >> >>>> For additional commands, e-mail:
> >> >>> [EMAIL PROTECTED]
> >> >>>>
> >> >>>>
> >> >>>> --
> >> >>>> This message has been 'sanitized'.  This means
> >> >>> that potentially
> >> >>>> dangerous content has been rewritten or removed.
> >> >>> The following
> >> >>>> log describes which actions were taken.
> >> >>>>
> >> >>>> Sanitizer (start="1171047249"):
> >> >>>>   Split unusually long Date: header.
> >> >>>>   SanitizeFile (filename="unnamed.txt",
> >> >>> mimetype="text/plain"):
> >> >>>>     Match (names="unnamed.txt", rule="2"):
> >> >>>>       Enforced policy: accept
> >> >>>>
> >> >>>>   Total modifications so far: 1
> >> >>>>
> >> >>>>
> >> >>>> Anomy 0.0.0 : Sanitizer.pm
> >> >>>> $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre
> >> >>> Exp $
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>>
> >> >>
> >> ---------------------------------------------------------------------
> >> >>> To unsubscribe, e-mail:
> >> >>> [EMAIL PROTECTED]
> >> >>> For additional commands, e-mail:
> >> >>> [EMAIL PROTECTED]
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >> Home page :
> >> >>   http://uk.geocities.com/matmsh/index.html
> >> >>
> >> >>
> >> >>
> >> >> ___________________________________________________________
> >> >> Now you can scan emails quickly with a reading pane. Get the new
> >> >> Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
> >> >>
> >> >>
> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >> --
> >> >> This message has been 'sanitized'.  This means that potentially
> >> >> dangerous content has been rewritten or removed.  The following
> >> >> log describes which actions were taken.
> >> >>
> >> >> Sanitizer (start="1171048257"):
> >> >>   Split unusually long Date: header.
> >> >>   SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
> >> >>     Match (names="unnamed.txt", rule="2"):
> >> >>       Enforced policy: accept
> >> >>
> >> >>   Total modifications so far: 1
> >> >>
> >> >>
> >> >> Anomy 0.0.0 : Sanitizer.pm
> >> >> $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> ---------------------------------------------------------------------
> >> > 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]
> >> >
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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]
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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]
>
>
>

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




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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

Reply via email to