Eve Pokua wrote:
> Micheal/ Ibraham.
>  
> Thank you all.
>  
>  
> But I am still having problems
>  
>                              <td>
>                                  <div style=""><img border="1" 
> src="c:/bapics/<%=(bpic)%>"      height="160" width="160"  
> title="picture2"/></div>
>                                 </td>
>
This will not work. the src attribute is used by the CLIENT's browser to 
find the image. The src above tells the client's browser to look on 
THEIR C drive for the image. It's unlikely to be there.

>  
> I have the string Dock.jpg in an attribute in the table
> If I use this:
> <display:column property="bpic" title="Picture"/>
> the string Dock.jpeg is displayed but not as image.
No. Because DisplayTag is taking the property and outputting its value 
as a string. You need to put it into an img tag.


>  
> All I want to do is tell the img tag src to display whatever .jpeg is 
> in the bpic attribute
> to be display as image. Why I'm I having so much problems?
>  
> It seems to work for this guy.-
>  
> http://www.coderanch.com/t/453478/JSP/java/Displaying-images-dynamically-from-database
>  

That's because his images are in a sub-folder relative to the location 
of his jsp page.

Assuming you're using Tomcat:

if your jsp page is at /ROOT/jsps/mytableofimages.jsp and your images 
are in /ROOT/images you can construct a <display:column> tag:

<display:column>
    <img src="../images/${bpic}"/>
</display:column>

Which will tell the client browser to request the image from your web 
server's images folder.

Of course if you're using a Servlet or Struts Action then the path to 
the image will be relative to the Servlet's location NOT the jsp page.

Ed!


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to