Re: accessing form beans with java objects in XSL

Dudley Butt <[email protected]> Thu, 10 Mar 2005 22:22:04 +0200
Newsgroups gmane.comp.java.strutscx.user
Message-ID <[email protected]>
Hi thanx Berny, thats great, all worked out, i will give the
validation thing a bash tomorrow, thx for the assistance once again,
appreciate it


On Thu, 10 Mar 2005 21:15:05 +0100, Bernhard Woehrlin
<[email protected]> wrote:
> Hi Dudley,
> 
> To access the work phone of your ContactDetails (XML serialized) Bean simply
> use:
> 
> <xsl:value-of select="//ContactDetails/workPhone"/>
> 
> Watch out: if you run this XSLT over your XML-Output it won't output
> anything because the XML element is empty (because of you haven't set a
> workPhone value into your ContactDetails Bean yet, right...?!)
> 
> Best regards,
> 
> Berny
> 
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Dudley
> Butt
> Gesendet: Donnerstag, 10. März 2005 20:44
> An: [email protected]
> Betreff: [Strutscx-user] accessing form beans with java objects in XSL
> 
> Hi Berny,
> 
> I see the bean i'm trying to access is part of my actionform in the
> debug=xml
> Here is the xml output snippet...
> 
> <!--********** ACTIONFORM **********-->
> -
>        <actionform>
> -
>        <EnrollmentForm>
> <index/>
> -
>        <HashMap>
> <empty>true</empty>
> <class>class java.util.HashMap</class>
> </HashMap>
> <productType/>
> <action/>
> -
>        <ValidatorResults>
> -
>        <HashMap>
> <empty>true</empty>
> <class>class java.util.HashMap</class>
> </HashMap>
> -
>        <class>
> class org.apache.commons.validator.ValidatorResults
> </class>
> </ValidatorResults>
> <page>0</page>
> -
>        <class>
> class com.thawte.presentation.retail.actionform.EnrollmentForm
> </class>
> -
>        <ContactDetails>
> <workPhone/>
> <jobTitle/>
> <firstName/>
> <lastName/>
> -
>        <class>
> class com.thawte.presentation.valueobject.ContactDetails
> </class>
> <emailAddress/>
> </ContactDetails>
> -
>        <ActionServletWrapper>
> -
>        <class>
> class org.apache.struts.action.ActionServletWrapper
> </class>
> </ActionServletWrapper>
> <multipartRequestHandler/>
> </EnrollmentForm>
> </actionform>
> <!--********** ACTIONERRORS **********-->
> -
>        <errors>
> <firstName/>
> </errors>
> 
> What would my xpath statement have to look like to reference the
> ContactDetails bean? Or can i use some fancy xslt to reference it in a
> simple manner?
> Thanx again for your help.
> Dudley
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Strutscx-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/strutscx-user
> 
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click