Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

What is wrong with this jsp code?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic