commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Schaare <fscha...@htp-tel.de>
Subject Re: [Digester]How to access created objects
Date Tue, 04 Nov 2003 18:16:59 GMT
Hi José,

>
> I'll try to explain as far as my knowdledge of Digester and my english 
> skills could.

Your english seems to be much better then mine ;-)

My article of reference is O'Reilly's one :
http://www.onjava.com/lpt/a/2746

This is the first of three articles found on digesters home. In fact, 
most of my code ist taken from this article

digester.addObjectCreate("Abfragen",Abfragen.class);
When <Abfragen> is found create a new Abfragen object and put it on top 
of stack ( above 'this' )

I´m totally confused about this stack . How can i access this 
Abfragen(Bean) ? I expectet something like:
getServletContext().getAttribute("Abfragen");
seesion.getAttribute("Abfragen"); or
request.getAttribute("Abfragen");

But what about the stack ?

> if  the Abfragen class has a method called
> public void addAbfrage(Abfrage beanObject)
> you will found your beans there.

hmm, but therefore, i need the Abfragen-instance. Is there a getter for 
the stack ?

>     digester.addSetNext("Abfragen","addAbfragen");
> and add that method
>     public void addAbfragen(Abfragen beanContainerObject)
> to your servlet.
> Digester will call it and pass the newly created Abfragen instance and 
> you will have everything at your disposition.

do you have a code example for this ? When i digest the xml file, i´m in 
ActionServlets init() method. Do i have to add another method like your 
description ?




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


Mime
View raw message