• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

logic equal syntax

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
@1) see i was trying to compare value from bean write it is not working
if i simply put bean write i can see value can anybody tell me where i am going wrong, and if i hardcode value with for example 11 it works

<logic:equal name="idea" property="catid" value="<bean:write name='idea' . property='catid'/>">
@here in side #1@<bean:write name='idea' property='catid'/>
</logic:equal>
@2)
if i give single code around bean write it throws error like
(53,65) equal symbol expected

<logic:equal name="category" property="id" value='<bean:write name='idea' property='catid'/>/>
@here in side #2@
</logic:equal>
please do reply
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<logic:equal name="category" property="id" value='<bean:write name='idea' property='catid'/>/>
@here in side #2@
</logic:equal>


For option 2, you are not closing the value attribute of the logic:equal tag, you need a ' to enclose the bean:write tag, though this may just change the error, not fix it.
For option 1, I'm not sure you can nest a bean:write inside a logic tag (could someone confirm this?). You could try something like

I also think your logic may be flawed, you seem to be asking if the catid of the idea bean is equal to itself. This will alway be true, and hence there is no point in doing the evaluation in the first place as you can just do a bean:write.
Hope this is of help...
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic