Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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.
What are your superhero powers? Go ahead and try them on this tiny ad:
Rocket Oven Kickstarter - from the trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!