Try putting this somewhere on your page, outside of your displaytag and then
"View Source" to see what the value actually is:

<!-- pic = ${pic} -->

If you're correct you should see something like:

<!-- pic = menjeans.png -->

But I suspect you won't.  For that to work, something has had to initialize
the pic attribute in one of the page, request, session, or application
scopes, which I suspect isn't happening.

Another thing, ${images/pic} is not the same thing as images/${pic}.  The
first is looking for an attribute in the above scopes named "images/pic".
The second is going to add the value of the "pic" attribute (from our
comment above) to the static string images/ so in our example, you should
end up with "images/menjeans.png".

But as was said before, this is basic JSP knowledge, not DisplayTag
specific.  Maybe someone here can point you at a good beginners JSP list.
  (*Chris*)

2009/10/9 Eve Pokua <gorgeou...@msn.com>

>  Hi,
>
> ${pic}
>
> is a DB table attribute which contains the value or string -
>
> menjeans.png
>
> basically a picture string.
>
> cod
> <display:column><img src="${images/menjeans.png}"
> alt="Picture"></img></display:column>
>                            <display:column><img src="${images/balpic}"
> alt="Picture"></img></display:column>
>                             <display:column><img src="images/menjeans.png"
> alt="Picture"></img></display:column>
>
> HTML generation -
>
> <td><img src="0" alt="Picture"></img></td>
> <td><img src="0" alt="Picture"></img></td>
> <td><img src="images/menjeans.png"
> alt="Picture"></img></td></tr></tbody></table>
>
>  Thanking you.
>
> eve
> ------------------------------
> Date: Fri, 9 Oct 2009 18:54:52 -0500
> From: emmecin...@gmail.com
> To: displaytag-user@lists.sourceforge.net
> Subject: Re: [displaytag-user] displaying images with displaytag issues
>
> What is "pic"?  Where's it b being set? Is it a column value?  When you
> say, "it doesn't work", how do you know that?  What does the generated HTML
> look like (which is to ask, what is the value of ${pic} when JSP expands
> that expression)?
>
> What you need to be doing is arranging for the <img> tag to reference a URL
> that includes something that your server can use to load the image file.
>
> I seriously doubt there's a displaytag issue here.
>
>
> 2009/10/9 Eve Pokua <gorgeou...@msn.com>
>
> Miguel
>
> <display:column><img src="images/menjeans.png"
> alt="Picture"></img></display:column>
>
> Yes it works.
>
> but how do I display an attribute-
>
>  <display:column><img src="images/${pic}"
> alt="Picture"></img></display:column>
>
> Thank you for your quick reply.
>
> eve
>
> ------------------------------
> From: mig...@almeida.at
> To: displaytag-user@lists.sourceforge.net
> Date: Sat, 10 Oct 2009 00:02:33 +0100
> Subject: Re: [displaytag-user] displaying images with displaytag issues
>
> Just on a sanity check, does this work:
>
>
> <display:column><img src="images/menjeans.png"
> alt="Picture"></img></display:column>
>
> ?
>
> On Fri, 2009-10-09 at 23:54 +0100, Eve Pokua wrote:
>
> hello everyone,
>
> I have open up this thread again because I've come to a conclusion it's a
> displaytag
> problem.
>
> I've the string menjeans.png in a DB.  This works for me without
> displaytag.
>
>                <%
>                     String pic2="menjeans.png";%>
>                  <img src="images/<%= pic2 %>">
>
> With displaytag -
>
> <display:column><img src="images/<=bpic>"
> alt="Picture"></img></display:column>
> <display:column><img src="images/=bpic"
> alt="Picture"/></img></display:column>
> <display:column><img src="${images/bpic}"
> alt="Picture"></img></display:column>
> <display:column><img src="images/${bpic}"
> alt="Picture"></img></display:column>
>
> None of the above works. And this -
>
> <display:column><img src="images/<%=balpic%>"
> alt="Picture"/></img></display:column>
>
> Can't even ran my application with that.
>
> So what is your suggestions?
>
> I don't want to have to stop using displaytag as the picture display is an
> important part of the application.
>
> Thanking you.
>
> regards
>
> eve
>
> ------------------------------
>
> Have more than one Hotmail account? Link them together to easily access
> both. <http://clk.atdmt.com/UKM/go/167688463/direct/01/>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register 
> now!http://p.sf.net/sfu/devconference
> _______________________________________________ displaytag-user mailing list 
> displaytag-user@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
>
> ------------------------------
> View your other email accounts from your Hotmail inbox. Add them 
> now.<http://clk.atdmt.com/UKM/go/167688463/direct/01/>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> displaytag-user mailing list
> displaytag-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
>
>
>
> --
> Turtle, turtle, on the ground,
> Pink and shiny, turn around.
>
> ------------------------------
> Add other email accounts to Hotmail in 3 easy steps. Find out 
> how.<http://clk.atdmt.com/UKM/go/167688463/direct/01/>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> displaytag-user mailing list
> displaytag-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to