Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:05:32+00:00 2026-05-15T21:05:32+00:00

For many internal problems that doesn’t count now, We have a Servlet filter that

  • 0

For many internal problems that doesn’t count now, We have a Servlet filter that changes all outcome that’s application/xhtml+xml and rewrite to text/html;charset=UTF-8 so even using the facelets it’ll work with no problem with IE 6.0.

My question is on the HtmlResponseWriter, which is the component responsible for the rendering. Is it possible to extend it and override its methods so we accomplish the desired effect of the filter?

  • The content type will always be output as text/html;
  • The encoding will be always UTF-8;
  • The script tag will be wrapped inside a < ! -- <[[CDATA ]]> --> .

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:05:33+00:00Added an answer on May 15, 2026 at 9:05 pm

    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 application/xhtml+xml. This is just to make sure it is in fact inside the HtmlResponseWriter class. JSF component frameworks can be complex so you never know, there may be other instances where this header is rendered.

    Since the HtmlResponseWriter isn’t declared final like some components are, you can just extend this, and override the method where application/xhtml+xml is being printed and register it in faces-config.xml. The only obstacles to this is if there are private variables declared inside of HtmlResponseWriter 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 HtmlResponseWriter class (by extending the ResponseWriter and mimicking each method and instance variable). The benefit of extending the HTMLResponseWriter is that you will pick up any changes (from JSF updates) to it automatically (except in the overridden method of course).

    Update:
    This is what I did for my faces-config.xml, but it is using Oracle ADF:

    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
      <application>
        <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
      </application>
      <render-kit>
        <render-kit-id>oracle.adf.rich</render-kit-id>
        <renderer>
          <component-family>org.apache.myfaces.trinidad.Input</component-family>
          <renderer-type>oracle.adf.rich.Text</renderer-type>
          <renderer-class>com.company.jsf.renders.text.CustomRenderer</renderer-class>
        </renderer>
      </render-kit>
    </faces-config>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to Unit Test a class that has many internal functions. These obviously
Many times I have seen Visual Studio solutions which have multiple projects that share
Many applications have grids that display data from a database table one page at
I need to generate many internal client-side (within the company only) graphs from streams
Many of us have used Perfmon tool to do performance analysis. Especially with .Net
Many times we find ourselves working on a problem, only to figure out the
Many frameworks seek to abstract away from HTML (custom tags, JSFs component system) in
Many people use Mock Objects when they are writing unit tests. What is a
Many beginning programmers write code like this: sub copy_file ($$) { my $from =
Many websites, including this one, add what are apparently called slugs - descriptive but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.