Editing response content on doView() <p>I have a simple <code>JSR 286</code> Portlet that displays a user manual (pure <code>HTML</code> code, not <code>JSP</code>).</p> <p>Actually, my <code>doView</code> method, just contains this : </p> <pre class="lang-java prettyprint-override"><code>public class UserManualPortlet extends GenericPortlet { @Override protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher( "/html/usermanual.html"); rd.include(request, response); } } </code></pre> <p>This works as expected, however I'm having trouble when including images. I'm aware that the path to images should be something like : </p> <pre class="lang-java prettyprint-override"><code>&lt;img src='&lt;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/html/image.jpg")%&gt;'/&gt; </code></pre> <p>However, my HTML file containing the user manual is used elsewhere, so I would like to preserve it as a pure HTML file.</p> <p>Is there a way to dynamically <strong>replace</strong> my classic <code>images urls</code> by something like the example above ? Perhaps using the <code>PrintWriter</code> of the response ?</p> <p>If such thing is not possible, I thing I would need to generate a <code>JSP</code> file during my <code>Maven</code> build.</p> <p>Any solution or ideas are welcome.</p>