Hi All ,
I am facing problem displaying balnk values when column values are null.I am using the following bellow code
#foreach ($item in $itemslist ) --- here itemslist is iterator $itemslist.getQty #end
output I am expecting is :
QTY: 123 345 567 itemslist.getQty (here itemlist having null value )
Expecting output as : QTY: 123 345 567 (itemlist having null value should display as blank value)
Any help is appreciated in this regard.
Thanks Venkat Dama
From: "Marin� A. J�nsson" <[EMAIL PROTECTED]> Reply-To: "Velocity Developers List" <[EMAIL PROTECTED]> To: "'Velocity Developers List'" <[EMAIL PROTECTED]> Subject: RE: using TilesTool was RE: Veltag and JJAR Date: Mon, 8 Sep 2003 20:13:50 -0000
ok. the fact that you want to extend definitions doesn't change the fact that the definitions in your demo are fundamentally flawed.
I don't know how your action-mappings are ... but these are the scenarios:
1. there is no definition for the top-level layout so i'm not sure how you forward to that one ... if you simply forward to /layout.vm (instead of a tiles-dev) you don't have access to the 'head' and 'body' values.
2. if you forward to the .main definition, body.vm is rendered - but you have no values for 'nav' nor 'someContent' and if you call them in body.vm you get an error. Aside from that, you put /body.vm as a definition path in the .main layout AND a value in the same defninition and thus call it recursively in the template, which is bound to be a little funky ;)
3. if you forward to the .news definition you have access to all the relevant values, but you still have the recursion problem.
what you seem to be trying to achieve is very simple (this is the clean version - without a seperate 'body' definition):
<tiles-definitions>
<definition name=".main" path="/layout.vm"> <put name="head" value="head.vm" /> <put name="nav" value="defaultNav.vm"/> <put name="someContent" value="defaultContent.vm"/> </definition>
<definition name=".news" extends=".main"> <put name="nav" value="newsNav.vm"/> <put name="someContent" value="newsContent.vm"/> </definition>
<definition name=".mail" extends=".main"> <put name="nav" value="mailNav.vm"/> <put name="someContent" value="mailContent.vm"/> </definition>
</tiles-definitions>
then you forward to either .main, .news or .mail depending on the request :)
or (if you have to seperate the body):
<tiles-definitions>
<definition name=".main" path="/layout.vm"> <put name="head" value="head.vm" /> <put name="body" value=".main.body"/> </definition>
<definition name=".news" extends=".main"> <put name="body" value=".news.body"/> </definition>
<definition name=".mail" extends=".main"> <put name="body" value=".mail.body"/> </definition>
<definition name=".main.body"> <put name="nav" value="defaultNav.vm"/> <put name="someContent" value="defaultContent.vm"/> </definition>
<definition name=".news.body"> <put name="nav" value="newsNav.vm"/> <put name="someContent" value="newsContent.vm"/> </definition>
<definition name=".mail.body"> <put name="nav" value="mailNav.vm"/> <put name="someContent" value="mailContent.vm"/> </definition>
</tiles-definitions>
catch my drift? not very much resistance there - it's all in the definitions :)
cheers,
Marin�.
> -----Original Message----- > From: Tim OBrien [mailto:[EMAIL PROTECTED] > Sent: 8. september 2003 16:57 > To: 'Velocity Developers List' > Subject: RE: using TilesTool was RE: Veltag and JJAR > > > Not quite, but I'll take it. The .news definition extends > the .main definition, and adds (or in the real case > overrides) some attributes. Assume that .main is something > like the layout of www.yahoo.com, .news is an extension of > the .main layout for news.yahoo.com, and .mail is an > extension of the .main layout for mail.yahoo.com. > > I'm migrating from a JSP app which makes heavy use of the > Tiles taglib - the path of least resistance for me at this > time is to use FreeMarker. > > Tim > > -----Original Message----- > From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED] > Sent: Friday, September 05, 2003 8:41 PM > To: 'Velocity Developers List' > Subject: RE: using TilesTool was RE: Veltag and JJAR > > yeah ... it's just like i thought ... pretty funky ;) > > the correct tiles-defs for your purposes should probably be > more like this: > > > <tiles-definitions> > > <definition name=".main" path="/layout.vm"> > <put name="head" value="head.vm" /> > <put name="body" value=".news" /> > </definition> > > <definition name=".news" path="/body.vm"> > <put name="nav" value="newsNav.vm"/> > <put name="someContent" value="newsContent.vm"/> > </definition> > > </tiles-definitions> > > > then, you forward to .main in the relevant struts action mapping :) > > > a cleaner version of the templates would be: > > in layout.vm: > > <html> > $tiles.head > $tiles.body > </html> > > in body.vm: > > <body> > $tiles.nav > $tiles.someContent > </body> > > (a little better than .get() ... and a whole lot better then > the #parse workaround ;) > > i think a RTFM comment would be appropriate here ;) but i > hope this helps. > > Marin� > > > > > -----Original Message----- > > From: Tim OBrien [mailto:[EMAIL PROTECTED] > > Sent: 5. september 2003 15:16 > > To: 'Velocity Developers List' > > Subject: RE: using TilesTool was RE: Veltag and JJAR > > > > > > Marin�, > > > > Here is the tiles-defs.xml that I am using. > > > > <tiles-definitions> > > > > <definition name=".main" path="/body.vm"> > > <put name="head" value="/head.vm" /> > > <put name="body" value="/body.vm" /> > > </definition> > > > > <definition name=".news" extends=".main"> > > <put name="nav" value="/newsNav.vm"/> > > <put name="someContent" value="/newsContent.vm"/> > > </definition> > > > > </tiles-definitions> > > > > I'm pretty sure they are funky as well. Although, this is > > what I've ended up with that works. > > > > Tim > > > > -----Original Message----- > > From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED] > > Sent: Thursday, September 04, 2003 7:04 PM > > To: 'Velocity Developers List' > > Subject: RE: using TilesTool was RE: Veltag and JJAR > > > > hmm ... I'm pretty sure your tiles definitions are a little > > funky ;) Could you perhaps show me the tiles-defs for this > > little demo? > > > > Marin� > > > > > -----Original Message----- > > > From: Tim OBrien [mailto:[EMAIL PROTECTED] > > > Sent: 4. september 2003 23:28 > > > To: 'Velocity Developers List' > > > Subject: using TilesTool was RE: Veltag and JJAR > > > > > > > > > Assume that you have a top-level layout in "layout.vm" and it > > > contains the > > > following: > > > > > > <html> > > > $tiles.get('head') > > > $tiles.get('body') > > > </html> > > > > > > Now assume that "body" refers to another template > "body.vm", which > > > in turn contains the following: > > > > > > <body> > > > $tiles.get('nav') > > > $tiles.get('someContent') > > > </body> > > > > > > I run this, I debug TilesTool with Eclipse, and when > > > TilesTool.get() tries to get the attribute 'nav', the > > > ComponentContext object contains zero attributes - so I'll > > > get a ServletException because TilesTool can't find > > > 'nav'..... My solution is to just call #parse. So, layout.vm > > > would call: > > > > > > <html> > > > #parse( $tiles.getString('head') ) > > > #parse( $tiles.getString('body') ) > > > </html> > > > > > > and "body.vm" would have: > > > > > > <body> > > > #parse( $tiles.getString('nav') ) > > > #parse( $tiles.getString('someContent') ) > > > </body> > > > > > > I was going to try to use the veltag so that I could use > the Tiles > > > taglib, but after 5 minutes going down that path, I was > reminded of > > > the fact that I dislike using JSP w/ taglibs - too much typing. > > > > > > Tim > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: Marin� A. J�nsson [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, September 04, 2003 6:13 PM > > > To: 'Velocity Developers List' > > > Subject: RE: Veltag and JJAR > > > > > > yup ... you've also aroused *my* curiosity ... since the > TilesTool > > > is *my* baby ;) have any more info on the problem? > > > > > > cheers, > > > Marin� > > > > > > > -----Original Message----- > > > > From: Nathan Bubna [mailto:[EMAIL PROTECTED] > > > > Sent: 4. september 2003 21:46 > > > > To: Velocity Developers List > > > > Subject: Re: Veltag and JJAR > > > > > > > > > > > > Tim OBrien said: > > > > > I was using Struts w/ Velocity and I wanted to work with > > > > the tiles tag > > > > > library because I was having problems calling > > > > $tiles.get('blah') from > > > > > anything but the top layout. > > > > > > > > hmm. so this was a problem with the TilesTool? can you give an > > > > example or any more info on your setup? we'd like to > get issues > > > > with the new tools worked out before the next release, > and others > > > > may be experiencing the same problem. > > > > > > > > > After experimenting with mixed JSP/Velocity > > > > > content, I decided to take a more pragmatic approach > > and solve my > > > > > problem by referencing tiles using #parse( > > > > $tiles.getString('menu') ). > > > > > So, my initial need to use veltag is no more. > > > > > > > > glad you found a way that works for you! there are > > certainly quite > > > > a few options for doing layout stuff with > > > > VelocityView/VelocityStruts. (of course, we'd like them > > all to work > > > > for you :) > > > > > > > > > But.. trying to build veltag was a confusing > > experience. Someone > > > > > should update the build and the site, and make no mention > > > of JJAR - > > > > > JJAR seems to be dead. I had to login to Minotaur to > > > > figure that out. > > > > > I'll volunteer to refactor this build if no one else has the > > > > > bandwidth. > > > > > > > > i believe veltag and it's docs are in the main velocity > > cvs. so, i > > > > can't check in those changes, but i'm sure the core velocity > > > > committers would appreciate any contribution like that. > > just file > > > > the report and any patches with bugzilla. > > > > > > > > Nathan Bubna > > > > [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] > > --------------------------------------------------------------------- > 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]
_________________________________________________________________
Try MSN Messenger 6.0 with integrated webcam functionality! http://www.msnmessenger-download.com/tracking/reach_webcam
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
