title: Custom Viewhandler for JBoss 7.1
body: <p>I want to implement a custom ViewHandler. Currently I'm only forwarding all calls to the default Viewhandler, but if I enable this ViewHandler in my faces-config.xml, the preRenderView event type (and maybe other functionality) is broken. Does anybody no what I'm doing wrong?</p>
  
  <p>I'm using JBoss AS 7.1.1.</p>
  
  <p>Thanks.</p>
  
  <pre><code>public class ReverseProxyViewHandler extends ViewHandler {
  
  ViewHandler defaultHandler;
  
  public ReverseProxyViewHandler(ViewHandler defaultHandler) {
      this.defaultHandler = defaultHandler;
  }
  
  @Override
  public Locale calculateLocale(FacesContext context) {
      return defaultHandler.calculateLocale(context);
  }
  
  @Override
  public String calculateRenderKitId(FacesContext context) {
      return defaultHandler.calculateRenderKitId(context);
  }
  
  @Override
  public UIViewRoot createView(FacesContext context, String viewId) {
      return defaultHandler.createView(context, viewId);
  }
  
  @Override
  public String getActionURL(FacesContext context, String path) {
      return defaultHandler.getActionURL(context, path);
  }
  
  @Override
  public String getResourceURL(FacesContext context, String path) {
      return defaultHandler.getResourceURL(context, path);
  }
  
  @Override
  public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException {
      defaultHandler.renderView(context, viewToRender);
  }
  
  @Override
  public UIViewRoot restoreView(FacesContext context, String viewId) {
      return defaultHandler.restoreView(context, viewId);
  }
  
  @Override
  public void writeState(FacesContext context) throws IOException {
      defaultHandler.writeState(context);
  }
  
  }
  </code></pre>