See More

package javaforce; /** HTML. * * Helper functions for generating HTML. * * @author pquiring */ public class HTML { /** Generate html.form.input * @param name = element name (optional) * @param id = element id (optional) * @param value = default value (optional) */ public static String input_field(String name, String id, String value) { StringBuilder sb = new StringBuilder(); sb.append(""); return sb.toString(); } /** Generate html.form.input[type=checkbox] * @param name = element name (optional) * @param id = element id (optional) * @param checked = checkbox is initial checked */ public static String input_checkbox(String name, String id, boolean checked) { StringBuilder sb = new StringBuilder(); sb.append(""); return sb.toString(); } /** Generate html.form.select. * @param name = element name (optional) * @param id = element id (optional) * @param options = array[value, text] * @param selected_value = selected value (optional) * @param selected_text = selected text (optional) * @param show_default = include a null 'Select...' option */ public static String select(String name, String id, String[][] options, String selected_value, String selected_text, boolean show_default) { StringBuilder sb = new StringBuilder(); sb.append(""); return sb.toString(); } /** Generate html.form.select. * Invokes select() with show_default = true */ public static String select(String name, String id, String[][] options, String selected_value, String selected_text) { return select(name, id, options, selected_value, selected_text, true); } /** Generate HTML stack trace of exception. */ public static String toString(Exception ex) { StringBuilder sb = new StringBuilder(); sb.append("Exception:"); sb.append(ex.toString()); sb.append("
"); StackTraceElement[] stes = ex.getStackTrace(); for(StackTraceElement ste : stes) { sb.append(ste.toString()); sb.append("
"); } return sb.toString(); } }