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

  • SEARCH
  • Home
  • 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 6386537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:02:20+00:00 2026-05-25T03:02:20+00:00

I have to integrate the Facebook social plugins into a JSF application. This recommends

  • 0

I have to integrate the Facebook social plugins into a JSF application. This recommends that I add the fbml namespace to the xhtml file that it’s rendered in the response.

I have in my XHTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  ...
  xmlns:fb="http://www.facebook.com/2008/fbml"
  xmlns:og="http://ogp.me/ns#">

But the fb and og namespace won’t be shown in the rendered source, only the XHTML namespace. How can I get these namespaces written to the response?

There is this issue: https://stackoverflow.com/questions/5199176/include-facebook-social-plugins-in-a-jsf2-page but it has not been answered yet.

The only idea I’ve got is to make an iframe and include a simple XHTML file (not a Facelet, just pure XHTML), but this seems to be dirty.

I hope someone has a better solution to that.


Additional information: I’m using facelets and seam 2.2.

I assume that ResponseWriter.startDocument() prints the Doctype and <html> element, is that correct? Or ist it just another UIComponent that renders the <html> element? It would be nice if I just could implement a custom ResponseWriter and override startDocument() and set my custom writer as default.

This leads me to 2 questions:

  1. Which class should I override so I don’t have to implement every method of the abstract ResponseWriter?
  2. How would I tell my application to use my custom ResponseWriter?

Or does implementing a custom component that renders the <html> tag the job? I’m asking this because facelets seems to render the <html> Tag by itself and there seems to be no way to change this, that’s why I came up with overriding the ResponseWriter.

  • 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-25T03:02:20+00:00Added an answer on May 25, 2026 at 3:02 am

    I found out that I just had to write a custom component:

    public class CvHTML extends UIOutput {
        @Override
        public void encodeBegin(final FacesContext context) throws IOException {
            final ResponseWriter writer = context.getResponseWriter();
            writer.startDocument();
            writer.startElement("HTML", null);
            writer.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml", null);
            writer.writeAttribute("xmlns:fb", "http://www.facebook.com/2008/fbml", null);
            writer.writeAttribute("xmlns:og", "http://ogp.me/ns#", null);
        }
    
        @Override
        public void encodeEnd(final FacesContext context) throws IOException {
            final ResponseWriter writer = context.getResponseWriter();
            writer.endElement("HTML");
            writer.endDocument();
        }
    }
    

    and call now in the main template:

    <cv:html xmlns="http://www.w3.org/1999/xhtml" lang="en"
        xmlns:s="http://jboss.com/products/seam/taglib"
        ....
        xmlns:cv="http://your.name.space/foo">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSP struts application that uses Spring to integrate with the services/dao/database.
We have an asp.net mvc application that we would like to integrate a FileSystemWatcher
With help of this post and this tutorial I have managed to integrate Facebook
I have successfully installed following items as i want to Integrate Facebook Chat Into
We have a social site, and want to integrate facebook connect to save time
I have integrated the Facebook Social Plugin into my Joomla Website. I have a
i have integrated facebook in a web system (facebook login and some social plugins
I have been asked to integrate facebook chat in my application using javascript. I
I'm trying to integrate Facebook into a site I'm developing, I have created a
I have an app. I want to integrate Facebook to this. I want to

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.