Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JSF2.0 custom component development  RSS feed

Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Ranchers,

I am developing a custom component with working environment Jboss 5.1 and JSF2.0 and jsf-facelets-1.1.15.B1. But i am not able to get it working.

Following are the classes and xml entries:




<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<facelet-taglib xmlns=""

and java classes

import javax.faces.component.UIComponentBase;

public class FrameComponent extends UIComponentBase{

public String getFamily() {
return "iFrame";

public String getRendererType() {
return "javax.faces.Frame";


import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;

public class FrameHandler extends ComponentHandler{

public FrameHandler(ComponentConfig config) {
// @Override
// protected MetaRuleset createMetaRuleset(Class type) {
// return super.createMetaRuleset(type).alias("class", "styleClass");
// }


import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.FacesRenderer;
import javax.faces.render.Renderer;
public class FrameRenderer extends Renderer {

public void encodeBegin(FacesContext context,UIComponent component) throws IOException {

ResponseWriter writer = context.getResponseWriter();

writer.startElement("iframe", null);
writer.writeAttribute("src", component.getAttributes().get("src"), "src");
writer.writeAttribute("style", component.getAttributes().get("style"), "style");
writer.writeAttribute("frameborder", component.getAttributes().get("frameborder"), "frameborder");
writer.writeAttribute("scrolling", component.getAttributes().get("scrolling"), "scrolling");

public void encodeEnd(FacesContext context,UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();

Also there is no entry in faces-config.xml

But whenever i am trying to load a page where this component is used i am getting error :
org.xml.sax.SAXParseException: Document root element "facelet-taglib", must match DOCTYPE root "null".

please help me out.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!