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

Ask A Question

Stats

  • Questions 486k
  • Answers 486k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use something like below. Notice though that I… May 16, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer This problem is a variant of linear optimization called integer… May 16, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer C-style arrays require literal values for initialization. Why use C-style… May 16, 2026 at 8:05 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.