baseurl attribute does not solve our problem.
Again here is problematic code:
Code:
class HTMLImageCache extends Hashtable<URL,Image>
{
@Override
public synchronized Image get(Object key)
{
if (key instanceof URL)
{
URL url = (URL)key;
String urlString = url.toExternalForm();
if (m_webappBaseUrl != null)
{
if (urlString.startsWith(m_webappBaseUrl))
{
urlString = urlString.substring(m_webappBaseUrl.length());
if (urlString.startsWith("/") == false)
urlString = "/" + urlString;
ImageIcon icon = getPage().loadImageIcon(urlString);
return icon.getImage();
}
}
}
return super.get(key);
}
}
when
m_webappBaseUrl llooks like: "http://host.com/some1/../some2/"
key is URL constructed from base "http://host.com/some1/../some2" and "img/someImg.gif" - it is normalized by URL class and then
Code:
String urlString = url.toExternalForm(); // ="http://host.com/some2/img/someImg.gif"
So line
Code:
if (urlString.startsWith(m_webappBaseUrl)) {...
fails. And image is not displayed while URL is correct.