aspose file tools*
The moose likes Struts and the fly likes What is wrong with this jsp code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "What is wrong with this jsp code?" Watch "What is wrong with this jsp code?" New topic
Author

What is wrong with this jsp code?

srinadh penugonda
Greenhorn

Joined: Feb 13, 2007
Posts: 13
<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


A 1.0 [92%]<br />P 6.0 [preparing]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61594
    
  67

You cannot use a custom action within the attribute of another custom action.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
srinadh penugonda
Greenhorn

Joined: Feb 13, 2007
Posts: 13
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

Joined: Jan 10, 2002
Posts: 61594
    
  67

Since the fragment in question employs the Struts tags, I've moved this to the Struts forum.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is wrong with this jsp code?