Developing the ViewHandler
The com.mycompany.jsf.pl.XMLViewHandlerImlp
supports
this type of view, defined by the combination of a view specification
class and an HTML template:
package com.mycompany.jsf.pl; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.Iterator; import java.util.Stack; import javax.faces.application.Application; import javax.faces.application.ViewHandler; import javax.faces.component.ActionSource; import javax.faces.component.UIComponent; import javax.faces.component.UISelectMany; import javax.faces.component.UISelectOne; import javax.faces.component.UIViewRoot; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import javax.faces.el.PropertyNotFoundException; import javax.faces.el.ValueBinding; import javax.faces.el.MethodBinding; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; public class XMLViewHandlerImpl extends ViewHandlerImpl { public XMLViewHandlerImpl(ViewHandler origViewHandler) { super(origViewHandler); }
The XMLViewHandlerImpl
class extends the
ClassViewHandlerImpl
class we developed in the previous section and inherits all its public methods. The differences ...
Get JavaServer Faces now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.