Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=3234967
By: rherrick

Quick answer: no.

A bit longer: the <img src> tag isn't evaluated until it hits the browser. 
That means that the entire path through the server, including the app name,
has to be there or it won't resolve properly.

Using an <html:image> tag or something similar that would resolve the 
application
context properly won't work because you can't embed a tag inside a tag.  Your
displaytags are evaluated and generate the HTML for the table.  If that HTML
contains further tags, when would they be evaluated?

One possible resolution to your issue, though, is to specify the application
context dynamically in your code and use some kind of pass-through to get the
server name from the servlet context (or don't use a pass-through and get it
directly from the server context!).  For example:

<%
   String appContext = config.getServletName();
%>

<img src="/<%= appContext %>/path/to/image.jpg"/>

I *believe* that config.getServletName() is what you want, but I'm not sure,
haven't messed with that in a while.  But give that a try, it should work. 
The parsing of JSP tags happens before the compilation of the JSP into Java,
so the displaytag stuff should be generated before the Java compilation.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=249318


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to