commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <japte...@indra.es>
Subject Re: [Digester]can't get the parse result
Date Tue, 07 Sep 2004 07:18:05 GMT
Copied from : http://www.theserverside.com/articles/article.tss?l=Digester
.....
The reason you need to push this initial object is because Digester
keeps pushing and popping objects from the stack as it encounters tags.
So the first object is created and pushed onto the stack upon
encountering the first tag, and this object is popped off the stack when
the last tag is processed. Because you need to hold a reference to the
object for the first tag, the initial object you push before you parse
the XML serves the purpose and retains a reference to that object.
....

Jos Antonio Prez Testa wrote:

>Hi Gao,
>You have to add an initial object to the Digester stack with
>digester.push (miObject);
>and add a new rule
>digester.addSetNext("CMS/CMD/GWPARAMS", "miObjectMethodName");
>in order to Digester to call <miObjectMethodName> with the Device in top
>of the stack, before pop the Device object and leave the stack empty (
>and the return null).
>
>Gao Di wrote:
>
>  
>
>>my xml is:
>><CMS>
>><CMD>
>><GWPARAMS name='shanghai'>
>><PR name='OSVER' value='V001'/>
>><PR name='HWVER' value='V002'/>
>><PR name='STATUS' value='ON'/>
>><PR name='CONNECTTIME' value='2004-08-30 16:50'/>
>><PR name='UPTIME' value='2004-08-30 16:50'/>
>></GWPARAMS>
>></CMD>
>></CMS>
>>and i want to put the the value into the javabean,i
>>use;
>>digester.addObjectCreate("CMS/CMD/GWPARAMS",
>>"com.adt.service.transfer.model.Device");
>>digester.addSetProperties("CMS/CMD/GWPARAMS");	
>>digester.addSetProperty("CMS/CMD/GWPARAMS/PR","name","value");
>>	
>>device = (Device)digester.parse(os.getReader());
>>
>>i find the parse can find the set method and put the
>>value in it,but when i use get method to get the
>>result,i only get null,it seems the value can't be
>>persisted,that's why?	
>>
>>_________________________________________________________
>>Do You Yahoo!?
>>150MP3ѣֵ
>>http://music.yisou.com/
>>ŮӦоУѱͼͼͿͼ
>>http://image.yisou.com
>>1G1000ףŻݣ
>>http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>> 
>>
>>    
>>
>-------------------------------------------------------------------------------------------------------------------
>Este correo electrnico y, en su caso, cualquier fichero anexo al mismo, contiene informacin
de carcter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda
prohibida su divulgacin, copia o distribucin a terceros sin la previa autorizacin escrita
de Indra. En el caso de haber recibido este correo electrnico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvo a la direccin electrnica del remitente.
>
>The information in this e-mail and in any attachments is confidential and solely for the
attention and use of the named addressee(s). You are hereby notified that any dissemination,
distribution or copy of this communication is prohibited without the prior written consent
of Indra. If you have received this communication in error, please, notify the sender by reply
e-mail
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>
-------------------------------------------------------------------------------------------------------------------
Este correo electrnico y, en su caso, cualquier fichero anexo al mismo, contiene informacin
de carcter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda
prohibida su divulgacin, copia o distribucin a terceros sin la previa autorizacin escrita
de Indra. En el caso de haber recibido este correo electrnico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvo a la direccin electrnica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention
and use of the named addressee(s). You are hereby notified that any dissemination, distribution
or copy of this communication is prohibited without the prior written consent of Indra. If
you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
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