Thanks James,

I am going to check the autowire stuff!

Do you have an answer for that:
Also I have faced a new problem:
I have migrated .page and .jwc to tapestry 4 DTD (using XSLT), using
the <property name="myProperty" >null</property>  has changed
quite a lot.  In tap 3 I used that instead of initialize() to handle
transient properties and correct initialization.
In my code I have two methods NON ABSTRACT getMyProperty and
setMyProperty and a private variable myProperty.  Those methods seems
to never be accessed?
It seems that the property binding overrides my methods definitions!!!?
Do you know how to avoid this, because initialize() method in the
page seems to be deprecated, and i don't want abstract methods.
Do I have to go through all my pages to find properties that are
defined in the .page and which are not abstract ?
What can I do ?

Do you know why when you define a property it overrides the concretes methods instead of leaving them. Do you know which part of tapestry is creating the concrete class, maybe I should look in the code. the "<property />" should never override already defined method but just call them with the correct initialization value or null if no initialization value was provided.

Thanks for your answers.

Numa



Le 11 févr. 07 à 14:02, James Carman a écrit :

The tapestry-autowire will look for abstract "getters" and it will
implement them for you if it can (by finding exactly one hivemind
service which matches the type).  In your case, it seems like you've
got quite a bit of work on your hands.  I'd consider putting the
abstract getter in your base page class (most people have a base
page/component class that they extend).  Then, look for all
implementations of that method and remove them.

On 2/11/07, Numa Schmeder <[EMAIL PROTECTED]> wrote:
Hello

Thanks for your answer,
But tap4.1 seems to need java 1.5 and I am restricted to java 1.4.
So any library dependant of java 1.5 can't be used.
If the service point is in module "com.mymodule" and is called
daoFactory , and if I have an abstract method getDAOFactory, it will
be autowired without any annotation or anything?  If true that would
be amazing!

Also I have faced a new problem:
I have migrated .page and .jwc to tapestry 4 DTD (using XSLT), using
the <property name="myProperty" default-value="null"/> has changed
quite a lot.  In tap 3 I used that instead of initialize() to handle
transient properties and correct initialization.
In my code I have two methods NON ABSTRACT getMyProperty and
setMyProperty and a private variable myProperty.  Those methods seems
to never be accessed?
It seems that the property binding overrides my methods definitions!!!?
Do you know how to avoid this, because initialize() method in the
page seems to be deprecated, and i don't want abstract methods.
Do I have to go through all my pages to find properties that are
defined in the .page and which are not abstract ?
What can I do ?

Thanks A lot

Numa


Le 10 févr. 07 à 21:13, James Carman a écrit :

> By the way, there has to be exactly one service point which is of the
> type that you need injected in order for it to be autowired, but
> that's traditionally the case when it comes to DAOs.
>
>
> On 2/10/07, James Carman <[EMAIL PROTECTED]> wrote:
>> 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: users- [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: users- [EMAIL PROTECTED]
>> > >
>> > >
>> > >
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: users- [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]

Reply via email to