public int doEndTag() throws JspException {
    try {
      JspWriter out = pageContext.getOut();
      if (includeScriptTags) {
        out.write("<script type=\"text/javascript\">\n");
      }
      if (globalErrorsId != null) {
        out.write("var tlGlobalErrorsId = '" + globalErrorsId + "';\n");
      }
      if (fieldErrorsIdSuffix != null) {
        out.write("var tlFieldErrorIdSuffix = '" + fieldErrorsIdSuffix + "';\n");
      }
      copy(getCodebaseReader(), out);
      if (includeScriptTags) {
        out.write("\n</script>");
      }
      return EVAL_PAGE;
    }
    catch (IOException e) {
      throw new JspException("Could not write validation codebase", e);
    }
  }