Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, we have extended JSF (actually Oracle ADF) components in order to meet special requirements that could not be done out of the box. You will need to get all of the source files of those renders and do a recursive search for the offending HTML you want removed, the <code>application/xhtml+xml</code>. This is just to make sure it is in fact inside the <code>HtmlResponseWriter</code> class. JSF component frameworks can be complex so you never know, there may be other instances where this header is rendered.</p> <p>Since the <code>HtmlResponseWriter</code> isn't declared <code>final</code> like some components are, you can just extend this, and override the method where <code>application/xhtml+xml</code> is being printed and <a href="http://www.coderanch.com/t/213094/JSF/java/Extending-JSF-Components" rel="nofollow noreferrer">register it</a> in <code>faces-config.xml</code>. The only obstacles to this is if there are private variables declared inside of <code>HtmlResponseWriter</code> being referenced in the method that you need to override. If that is the case you will either not be able to reference them in your reimplementation or you will have to completely re-build a new <code>HtmlResponseWriter</code> class (by extending the <code>ResponseWriter</code> and mimicking each method and instance variable). The benefit of extending the <code>HTMLResponseWriter</code> is that you will pick up any changes (from JSF updates) to it automatically (except in the overridden method of course).</p> <p>Update: This is what I did for my faces-config.xml, but it is using Oracle ADF:</p> <pre><code>&lt;?xml version="1.0" encoding="windows-1252"?&gt; &lt;faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"&gt; &lt;application&gt; &lt;default-render-kit-id&gt;oracle.adf.rich&lt;/default-render-kit-id&gt; &lt;/application&gt; &lt;render-kit&gt; &lt;render-kit-id&gt;oracle.adf.rich&lt;/render-kit-id&gt; &lt;renderer&gt; &lt;component-family&gt;org.apache.myfaces.trinidad.Input&lt;/component-family&gt; &lt;renderer-type&gt;oracle.adf.rich.Text&lt;/renderer-type&gt; &lt;renderer-class&gt;com.company.jsf.renders.text.CustomRenderer&lt;/renderer-class&gt; &lt;/renderer&gt; &lt;/render-kit&gt; &lt;/faces-config&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload