User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 426,134 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,755 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1193 | Replies: 2
Reply
Join Date: Apr 2007
Posts: 1
Reputation: jake_ryan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jake_ryan jake_ryan is offline Offline
Newbie Poster

what is wrong with this jsp expression?

  #1  
Apr 30th, 2007
<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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: what is wrong with this jsp expression?

  #2  
May 1st, 2007
I'm not too familiar with JSP at the moment. But you are confusing your HTML code with your interpreted code... I presume that JSP is parsed once. So you shouldn't include JSP tags inside other JSP tags.

I think the error it is reporting is that it thinks that "<bean:write name=" is the value of the src attribute. I think this isn't a problem in the a tag, because that tag is an html tag and not a JSP rendered tag.

instead of <html:image> use <img>.

actually I think this will work, but its not really knowledge, google should explain it better. which is probably a good idea ;-)
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 199
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: what is wrong with this jsp expression?

  #3  
May 2nd, 2007
<html:image> can in fact be correct, depending on the tag libraries in use.
It will likely generate an <img> tag based on its parameters.

But yes, the nesting of tags CAN be problematical. Especially when you're nesting custom tags with JSP taglets and scriptlets you're asking for trouble (nesting tags within a single tag library is usually fine).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:40 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC