This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is wrong with this jsp code?

 
srinadh penugonda
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
Merrill Higginson
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic