You need to use a code block for your HTML fragment so that we can see the HTML.
here it is
How is the URL generated in the portlet? Is it hardcoded or generated from PortletURL? You should always use PortletURL to generate URLs targetting your portlet. If PortletURL is used, it should work properly over WSRP. If the URL is hardcoded, then it's no surprise that it doesn't work over WSRP and actually is really fragile for your portlet locally as well.
it is not hardcoded, but I do not use Portlet URL
writer.println("<img src=\"" + response.encodeURL(request.getContextPath() + "/gif/agif.gif") + "\"/>");
I will try it with PortletURL
coded it with PortletURL
PortletURL url = response.createRenderURL(); writer.println("<img src=\"" + url.toString()+ "/gif/agif.gif" + "\"/>");
When invoking locally, following html code is generated:
-> not what I expected and definitely wrong
When invoking remote, I got back an exception
java.lang.IllegalArgumentException: wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite/gif/agif.gif does not end with /wsrp_rewrite at org.jboss.portal.wsrp.WSRPPortletURL.create(WSRPPortletURL.java:117)
Could you give me an sample code.
according to this documentation http://dev2dev.bea.com/pub/a/2006/12/writing-jsr-168-portlets.html
it is correct to use
PortletRequest.getContextPath and to use PortletResponse.encodeUrl to encode the URL
If there is another way (which works with WSRP) could you please send
me a code snippet.
It should indeed be working. I will be looking at it ASAP.
Fixed in subversion. Thanks for reporting the issue.