• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is wrong with this jsp code?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<div id="sidebar">
<logic:present name="userVO">
<logic:iterate id="element" name="userVO" property="features" indexId="i">
<a href="<bean:write name="userVO" property='<%= "featuresLinks["+ i +"]" %>' />" class="sidebar"> <html:image src="<bean:write name="userVO" property='<%= "imagePaths["+ i +"]" %>' />"/> </a>
</logic:iterate>
</logic:present>
<version data="11.01.04svp1"><sysinfo data=""></sysinfo></version>
</div>

I am trying to place a link with an image. However, I am getting run-time exception that says "equal symbol expected" in the expression.. It points to 'O' in userVO in the image:src
I am totally lost on why I am getting this error.. and any help/pointers in this regard will be much appreciated.
Thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot use a custom action within the attribute of another custom action.
 
srinadh penugonda
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear Bibeault
Appreciate the reply..
Can you please tell me how else can I achieve it ... I am just learning the tricks so any pointers/examples would be of great help.
Thanks again.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the fragment in question employs the Struts tags, I've moved this to the Struts forum.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless you're trying to create a submit button that uses an image file, <html:image> is the wrong tag to use. If you just want to display an image, <html:img> is the tag to use.

In any case, the Struts tags don't really buy you anything here, so my suggestion would be to use the plain html <img> tag. That way you can substitute a <bean:write> tag as the src attribute.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic