| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc (build 1.4.2_08) on Mon Nov 14 10:15:17 PST 2005 -->
|
| <TITLE>
|
| ValidatorTool (Velocity Tools 1.2 Documentation)
|
| </TITLE>
|
|
|
| <META NAME="keywords" CONTENT="org.apache.velocity.tools.struts.ValidatorTool class">
|
|
|
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
|
|
|
| <SCRIPT type="text/javascript">
|
| function windowTitle()
|
| {
|
| parent.document.title="ValidatorTool (Velocity Tools 1.2 Documentation)";
|
| }
|
| </SCRIPT>
|
|
|
| </HEAD>
|
|
|
| <BODY BGCOLOR="white" onload="windowTitle();">
|
|
|
| |
| <!-- ========= START OF TOP NAVBAR ======= -->
|
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
| <TR>
|
| <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
| <TR ALIGN="center" VALIGN="top">
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
| </TR>
|
| </TABLE>
|
| </TD>
|
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
| </EM>
|
| </TD>
|
| </TR>
|
|
|
| <TR>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../org/apache/velocity/tools/struts/TilesTool.html" title="class in org.apache.velocity.tools.struts"><B>PREV CLASS</B></A>
|
| NEXT CLASS</FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
|
| <A HREF="ValidatorTool.html" target="_top"><B>NO FRAMES</B></A>
|
| <SCRIPT type="text/javascript">
|
| <!--
|
| if(window==top) {
|
| document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
| }
|
| //-->
|
| </SCRIPT>
|
| <NOSCRIPT>
|
| <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
| </NOSCRIPT> |
|
|
| </FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= -->
|
|
|
| <HR>
|
| <!-- ======== START OF CLASS DATA ======== -->
|
| <H2>
|
| <FONT SIZE="-1">
|
| org.apache.velocity.tools.struts</FONT>
|
| <BR>
|
| Class ValidatorTool</H2>
|
| <PRE>
|
| java.lang.Object
|
| <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.velocity.tools.struts.ValidatorTool</B>
|
| </PRE>
|
| <DL>
|
| <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/velocity/tools/view/tools/ViewTool.html" title="interface in org.apache.velocity.tools.view.tools">ViewTool</A></DD>
|
| </DL>
|
| <HR>
|
| <DL>
|
| <DT>public class <B>ValidatorTool</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/apache/velocity/tools/view/tools/ViewTool.html" title="interface in org.apache.velocity.tools.view.tools">ViewTool</A></DL>
|
|
|
| <P>
|
| <p>View tool that works with Struts Validator to |
| produce client side javascript validation for your forms.</p> |
| <p>Usage: |
| <pre> |
| Template example: |
| |
| $validator.getJavascript("nameOfYourForm") |
| |
| Toolbox configuration: |
| <tool> |
| <key>validator</key> |
| <scope>request</scope> |
| <class>org.apache.velocity.tools.struts.ValidatorTool</class> |
| </tool> |
| </pre> |
| </p> |
| <p>This is an adaptation of the JavascriptValidatorTag |
| from the Struts 1.1 validator library.</p>
|
| <P>
|
|
|
| <P>
|
| <DL>
|
| <DT><B>Since:</B></DT> |
| <DD>VelocityTools 1.1</DD> |
| <DT><B>Version:</B></DT> |
| <DD>$Revision: 326310 $ $Date: 2005-10-18 17:47:39 -0700 (Tue, 18 Oct 2005) $</DD> |
| <DT><B>Author:</B></DT> |
| <DD>David Winterfeldt, David Graham, <a href="mailto:marinoj@centrum.is">Marino A. Jonsson</a>, <a href="mailto:nathan@esha.com">Nathan Bubna</a></DD> |
| </DL>
|
| <HR>
|
|
|
| <P>
|
| <!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
|
|
|
| <!-- =========== FIELD SUMMARY =========== -->
|
|
|
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Field Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private static java.util.Comparator</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#actionComparator">actionComparator</A></B></CODE>
|
|
|
| <BR>
|
| A Comparator to use when sorting ValidatorAction objects.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected javax.servlet.ServletContext</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#app">app</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the ServletContext</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#cdata">cdata</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected <A HREF="../../../../../org/apache/velocity/tools/view/context/ViewContext.html" title="interface in org.apache.velocity.tools.view.context">ViewContext</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#context">context</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the ViewContext</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#formName">formName</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#HTML_BEGIN_COMMENT">HTML_BEGIN_COMMENT</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#HTML_END_COMMENT">HTML_END_COMMENT</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#htmlComment">htmlComment</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#jsFormName">jsFormName</A></B></CODE>
|
|
|
| <BR>
|
| formName is used for both Javascript and non-javascript validations.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#methodName">methodName</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private int</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#page">page</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected javax.servlet.http.HttpServletRequest</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#request">request</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the HttpServletRequest.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected org.apache.commons.validator.ValidatorResources</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#resources">resources</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the ValidatorResources.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected javax.servlet.http.HttpSession</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#session">session</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the HttpSession.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#src">src</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#xhtml">xhtml</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
|
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Constructor Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#ValidatorTool()">ValidatorTool</A></B>()</CODE>
|
|
|
| <BR>
|
| Default constructor.</TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ========== METHOD SUMMARY =========== -->
|
|
|
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Method Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.util.List</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#createActionList(org.apache.commons.validator.ValidatorResources, org.apache.commons.validator.Form)">createActionList</A></B>(org.apache.commons.validator.ValidatorResources resources, |
| org.apache.commons.validator.Form form)</CODE>
|
|
|
| <BR>
|
| Get List of actions for the given Form.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#createMethods(java.util.List)">createMethods</A></B>(java.util.List actions)</CODE>
|
|
|
| <BR>
|
| Creates the JavaScript methods list from the given actions.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#escapeJavascript(java.lang.String)">escapeJavascript</A></B>(java.lang.String str)</CODE>
|
|
|
| <BR>
|
| Backslash-escapes the following characters from the input string: |
| ", ', \, \r, \n.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getCdata()">getCdata</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the cdata setting "true" or "false".</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getDynamicJavascript()">getDynamicJavascript</A></B>()</CODE>
|
|
|
| <BR>
|
| Render just the dynamic JavaScript to perform validations based |
| on the form name attribute of the action mapping associated |
| with the current request (if such exists).</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getDynamicJavascript(java.lang.String)">getDynamicJavascript</A></B>(java.lang.String formName)</CODE>
|
|
|
| <BR>
|
| Render just the dynamic JavaScript to perform validations based |
| on the supplied form name.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getDynamicJavascript(org.apache.commons.validator.ValidatorResources, java.util.Locale, org.apache.commons.validator.Form)">getDynamicJavascript</A></B>(org.apache.commons.validator.ValidatorResources resources, |
| java.util.Locale locale, |
| org.apache.commons.validator.Form form)</CODE>
|
|
|
| <BR>
|
| Generates the dynamic JavaScript for the form.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getHtmlComment()">getHtmlComment</A></B>()</CODE>
|
|
|
| <BR>
|
| Gets whether or not to delimit the |
| JavaScript with html comments.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascript()">getJavascript</A></B>()</CODE>
|
|
|
| <BR>
|
| Render both dynamic and static JavaScript to perform |
| validations based on the form name attribute of the action |
| mapping associated with the current request (if such exists).</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascript(java.lang.String)">getJavascript</A></B>(java.lang.String formName)</CODE>
|
|
|
| <BR>
|
| Render both dynamic and static JavaScript to perform |
| validations based on the supplied form name.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascript(java.lang.String, boolean)">getJavascript</A></B>(java.lang.String formName, |
| boolean getStatic)</CODE>
|
|
|
| <BR>
|
| Render both dynamic and static JavaScript to perform |
| validations based on the supplied form name.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascriptBegin(java.lang.String)">getJavascriptBegin</A></B>(java.lang.String methods)</CODE>
|
|
|
| <BR>
|
| Returns the opening script element and some initial javascript.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascriptEnd()">getJavascriptEnd</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the closing script element.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getJavascriptStaticMethods(org.apache.commons.validator.ValidatorResources)">getJavascriptStaticMethods</A></B>(org.apache.commons.validator.ValidatorResources resources)</CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getMethod()">getMethod</A></B>()</CODE>
|
|
|
| <BR>
|
| Gets the method name that will be used for the Javascript |
| validation method name if it has a value.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> int</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getPage()">getPage</A></B>()</CODE>
|
|
|
| <BR>
|
| Gets the current page number of a multi-part form.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getSrc()">getSrc</A></B>()</CODE>
|
|
|
| <BR>
|
| Gets the src attribute's value when defining |
| the html script element.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getStartElement()">getStartElement</A></B>()</CODE>
|
|
|
| <BR>
|
| Constructs the beginning <script> element depending on xhtml status.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#getStaticJavascript()">getStaticJavascript</A></B>()</CODE>
|
|
|
| <BR>
|
| Render just the static JavaScript methods.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#init(java.lang.Object)">init</A></B>(java.lang.Object obj)</CODE>
|
|
|
| <BR>
|
| Initializes this tool.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#setCdata(boolean)">setCdata</A></B>(boolean cdata)</CODE>
|
|
|
| <BR>
|
| Sets the cdata status.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#setHtmlComment(boolean)">setHtmlComment</A></B>(boolean htmlComment)</CODE>
|
|
|
| <BR>
|
| Sets whether or not to delimit the |
| JavaScript with html comments.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#setMethod(java.lang.String)">setMethod</A></B>(java.lang.String methodName)</CODE>
|
|
|
| <BR>
|
| Sets the method name that will be used for the Javascript |
| validation method name if it has a value.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#setPage(int)">setPage</A></B>(int page)</CODE>
|
|
|
| <BR>
|
| Sets the current page number of a multi-part form.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/struts/ValidatorTool.html#setSrc(java.lang.String)">setSrc</A></B>(java.lang.String src)</CODE>
|
|
|
| <BR>
|
| Sets the src attribute's value (used to include |
| an external script resource) when defining |
| the html script element.</TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class java.lang.Object</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <P>
|
|
|
| <!-- ============ FIELD DETAIL =========== -->
|
|
|
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Field Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="context"><!-- --></A><H3>
|
| context</H3>
|
| <PRE>
|
| protected <A HREF="../../../../../org/apache/velocity/tools/view/context/ViewContext.html" title="interface in org.apache.velocity.tools.view.context">ViewContext</A> <B>context</B></PRE>
|
| <DL>
|
| <DD>A reference to the ViewContext
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="app"><!-- --></A><H3>
|
| app</H3>
|
| <PRE>
|
| protected javax.servlet.ServletContext <B>app</B></PRE>
|
| <DL>
|
| <DD>A reference to the ServletContext
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="request"><!-- --></A><H3>
|
| request</H3>
|
| <PRE>
|
| protected javax.servlet.http.HttpServletRequest <B>request</B></PRE>
|
| <DL>
|
| <DD>A reference to the HttpServletRequest.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="session"><!-- --></A><H3>
|
| session</H3>
|
| <PRE>
|
| protected javax.servlet.http.HttpSession <B>session</B></PRE>
|
| <DL>
|
| <DD>A reference to the HttpSession.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="resources"><!-- --></A><H3>
|
| resources</H3>
|
| <PRE>
|
| protected org.apache.commons.validator.ValidatorResources <B>resources</B></PRE>
|
| <DL>
|
| <DD>A reference to the ValidatorResources.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="HTML_BEGIN_COMMENT"><!-- --></A><H3>
|
| HTML_BEGIN_COMMENT</H3>
|
| <PRE>
|
| private static final java.lang.String <B>HTML_BEGIN_COMMENT</B></PRE>
|
| <DL>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.struts.ValidatorTool.HTML_BEGIN_COMMENT">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="HTML_END_COMMENT"><!-- --></A><H3>
|
| HTML_END_COMMENT</H3>
|
| <PRE>
|
| private static final java.lang.String <B>HTML_END_COMMENT</B></PRE>
|
| <DL>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.struts.ValidatorTool.HTML_END_COMMENT">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="xhtml"><!-- --></A><H3>
|
| xhtml</H3>
|
| <PRE>
|
| private boolean <B>xhtml</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="htmlComment"><!-- --></A><H3>
|
| htmlComment</H3>
|
| <PRE>
|
| private boolean <B>htmlComment</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="cdata"><!-- --></A><H3>
|
| cdata</H3>
|
| <PRE>
|
| private boolean <B>cdata</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="formName"><!-- --></A><H3>
|
| formName</H3>
|
| <PRE>
|
| private java.lang.String <B>formName</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="methodName"><!-- --></A><H3>
|
| methodName</H3>
|
| <PRE>
|
| private java.lang.String <B>methodName</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="src"><!-- --></A><H3>
|
| src</H3>
|
| <PRE>
|
| private java.lang.String <B>src</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="page"><!-- --></A><H3>
|
| page</H3>
|
| <PRE>
|
| private int <B>page</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="jsFormName"><!-- --></A><H3>
|
| jsFormName</H3>
|
| <PRE>
|
| protected java.lang.String <B>jsFormName</B></PRE>
|
| <DL>
|
| <DD>formName is used for both Javascript and non-javascript validations. |
| For the javascript validations, there is the possibility that we will |
| be rewriting the formName (if it is a ValidatorActionForm instead of just |
| a ValidatorForm) so we need another variable to hold the formName just for |
| javascript usage.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="actionComparator"><!-- --></A><H3>
|
| actionComparator</H3>
|
| <PRE>
|
| private static final java.util.Comparator <B>actionComparator</B></PRE>
|
| <DL>
|
| <DD>A Comparator to use when sorting ValidatorAction objects.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
|
|
| <!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
|
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Constructor Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="ValidatorTool()"><!-- --></A><H3>
|
| ValidatorTool</H3>
|
| <PRE>
|
| public <B>ValidatorTool</B>()</PRE>
|
| <DL>
|
| <DD>Default constructor. Tool must be initialized before use.
|
| <P>
|
| </DL>
|
|
|
| <!-- ============ METHOD DETAIL ========== -->
|
|
|
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Method Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="init(java.lang.Object)"><!-- --></A><H3>
|
| init</H3>
|
| <PRE>
|
| public void <B>init</B>(java.lang.Object obj)</PRE>
|
| <DL>
|
| <DD>Initializes this tool.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/view/tools/ViewTool.html#init(java.lang.Object)">init</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/velocity/tools/view/tools/ViewTool.html" title="interface in org.apache.velocity.tools.view.tools">ViewTool</A></CODE></DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>obj</CODE> - the current ViewContext |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the param is not a ViewContext</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getPage()"><!-- --></A><H3>
|
| getPage</H3>
|
| <PRE>
|
| public int <B>getPage</B>()</PRE>
|
| <DL>
|
| <DD>Gets the current page number of a multi-part form. |
| Only field validations with a matching page number |
| will be generated that match the current page number. |
| Only valid when the formName attribute is set.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the current page number of a multi-part form</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setPage(int)"><!-- --></A><H3>
|
| setPage</H3>
|
| <PRE>
|
| public void <B>setPage</B>(int page)</PRE>
|
| <DL>
|
| <DD>Sets the current page number of a multi-part form. |
| Only field validations with a matching page number |
| will be generated that match the current page number.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>page</CODE> - the current page number of a multi-part form</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getMethod()"><!-- --></A><H3>
|
| getMethod</H3>
|
| <PRE>
|
| public java.lang.String <B>getMethod</B>()</PRE>
|
| <DL>
|
| <DD>Gets the method name that will be used for the Javascript |
| validation method name if it has a value. This overrides |
| the auto-generated method name based on the key (form name) |
| passed in.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the method name that will be used for the Javascript validation method</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setMethod(java.lang.String)"><!-- --></A><H3>
|
| setMethod</H3>
|
| <PRE>
|
| public void <B>setMethod</B>(java.lang.String methodName)</PRE>
|
| <DL>
|
| <DD>Sets the method name that will be used for the Javascript |
| validation method name if it has a value. This overrides |
| the auto-generated method name based on the key (form name) |
| passed in.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>methodName</CODE> - the method name that will be used for the Javascript validation method name</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getHtmlComment()"><!-- --></A><H3>
|
| getHtmlComment</H3>
|
| <PRE>
|
| public boolean <B>getHtmlComment</B>()</PRE>
|
| <DL>
|
| <DD>Gets whether or not to delimit the |
| JavaScript with html comments. If this is set to 'true', which |
| is the default, html comments will surround the JavaScript.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>true if the JavaScript should be delimited with html comments</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setHtmlComment(boolean)"><!-- --></A><H3>
|
| setHtmlComment</H3>
|
| <PRE>
|
| public void <B>setHtmlComment</B>(boolean htmlComment)</PRE>
|
| <DL>
|
| <DD>Sets whether or not to delimit the |
| JavaScript with html comments. If this is set to 'true', which |
| is the default, html comments will surround the JavaScript.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>htmlComment</CODE> - whether or not to delimit the JavaScript with html comments</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getSrc()"><!-- --></A><H3>
|
| getSrc</H3>
|
| <PRE>
|
| public java.lang.String <B>getSrc</B>()</PRE>
|
| <DL>
|
| <DD>Gets the src attribute's value when defining |
| the html script element.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the src attribute's value</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setSrc(java.lang.String)"><!-- --></A><H3>
|
| setSrc</H3>
|
| <PRE>
|
| public void <B>setSrc</B>(java.lang.String src)</PRE>
|
| <DL>
|
| <DD>Sets the src attribute's value (used to include |
| an external script resource) when defining |
| the html script element. The src attribute is only recognized |
| when the formName attribute is specified.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>src</CODE> - the src attribute's value</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getCdata()"><!-- --></A><H3>
|
| getCdata</H3>
|
| <PRE>
|
| public boolean <B>getCdata</B>()</PRE>
|
| <DL>
|
| <DD>Returns the cdata setting "true" or "false".
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>boolean - "true" if JavaScript will be hidden in a CDATA section</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setCdata(boolean)"><!-- --></A><H3>
|
| setCdata</H3>
|
| <PRE>
|
| public void <B>setCdata</B>(boolean cdata)</PRE>
|
| <DL>
|
| <DD>Sets the cdata status.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>cdata</CODE> - The cdata to set</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascript()"><!-- --></A><H3>
|
| getJavascript</H3>
|
| <PRE>
|
| public java.lang.String <B>getJavascript</B>() |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render both dynamic and static JavaScript to perform |
| validations based on the form name attribute of the action |
| mapping associated with the current request (if such exists).
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the javascript for the current form |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascript(java.lang.String)"><!-- --></A><H3>
|
| getJavascript</H3>
|
| <PRE>
|
| public java.lang.String <B>getJavascript</B>(java.lang.String formName) |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render both dynamic and static JavaScript to perform |
| validations based on the supplied form name.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>formName</CODE> - the key (form name) |
| <DT><B>Returns:</B><DD>the Javascript for the specified form |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getDynamicJavascript()"><!-- --></A><H3>
|
| getDynamicJavascript</H3>
|
| <PRE>
|
| public java.lang.String <B>getDynamicJavascript</B>() |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render just the dynamic JavaScript to perform validations based |
| on the form name attribute of the action mapping associated |
| with the current request (if such exists). Useful i.e. if the static |
| parts are located in a seperate .js file.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the javascript for the current form |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getStaticJavascript()"><!-- --></A><H3>
|
| getStaticJavascript</H3>
|
| <PRE>
|
| public java.lang.String <B>getStaticJavascript</B>() |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render just the static JavaScript methods. Useful i.e. if the static |
| parts should be located in a seperate .js file.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>all static Javascript methods |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getDynamicJavascript(java.lang.String)"><!-- --></A><H3>
|
| getDynamicJavascript</H3>
|
| <PRE>
|
| public java.lang.String <B>getDynamicJavascript</B>(java.lang.String formName) |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render just the dynamic JavaScript to perform validations based |
| on the supplied form name. Useful i.e. if the static |
| parts are located in a seperate .js file.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>formName</CODE> - the key (form name) |
| <DT><B>Returns:</B><DD>the dynamic Javascript for the specified form |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascript(java.lang.String, boolean)"><!-- --></A><H3>
|
| getJavascript</H3>
|
| <PRE>
|
| protected java.lang.String <B>getJavascript</B>(java.lang.String formName, |
| boolean getStatic) |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Render both dynamic and static JavaScript to perform |
| validations based on the supplied form name.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>formName</CODE> - the key (form name)<DD><CODE>getStatic</CODE> - indicates if the static methods should be rendered |
| <DT><B>Returns:</B><DD>the Javascript for the specified form |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getDynamicJavascript(org.apache.commons.validator.ValidatorResources, java.util.Locale, org.apache.commons.validator.Form)"><!-- --></A><H3>
|
| getDynamicJavascript</H3>
|
| <PRE>
|
| protected java.lang.String <B>getDynamicJavascript</B>(org.apache.commons.validator.ValidatorResources resources, |
| java.util.Locale locale, |
| org.apache.commons.validator.Form form)</PRE>
|
| <DL>
|
| <DD>Generates the dynamic JavaScript for the form.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the validator resources<DD><CODE>locale</CODE> - the locale for the current request<DD><CODE>form</CODE> - the form to generate javascript for |
| <DT><B>Returns:</B><DD>the dynamic javascript</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="escapeJavascript(java.lang.String)"><!-- --></A><H3>
|
| escapeJavascript</H3>
|
| <PRE>
|
| protected java.lang.String <B>escapeJavascript</B>(java.lang.String str)</PRE>
|
| <DL>
|
| <DD><p>Backslash-escapes the following characters from the input string: |
| ", ', \, \r, \n.</p> |
| |
| <p>This method escapes characters that will result in an invalid |
| Javascript statement within the validator Javascript.</p>
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>str</CODE> - The string to escape. |
| <DT><B>Returns:</B><DD>The string <code>s</code> with each instance of a double quote, |
| single quote, backslash, carriage-return, or line feed escaped |
| with a leading backslash.<DT><B>Since:</B></DT> |
| <DD>VelocityTools 1.2</DD> |
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="createMethods(java.util.List)"><!-- --></A><H3>
|
| createMethods</H3>
|
| <PRE>
|
| protected java.lang.String <B>createMethods</B>(java.util.List actions)</PRE>
|
| <DL>
|
| <DD>Creates the JavaScript methods list from the given actions.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>actions</CODE> - A List of ValidatorAction objects. |
| <DT><B>Returns:</B><DD>JavaScript methods.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="createActionList(org.apache.commons.validator.ValidatorResources, org.apache.commons.validator.Form)"><!-- --></A><H3>
|
| createActionList</H3>
|
| <PRE>
|
| protected java.util.List <B>createActionList</B>(org.apache.commons.validator.ValidatorResources resources, |
| org.apache.commons.validator.Form form)</PRE>
|
| <DL>
|
| <DD>Get List of actions for the given Form.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the validator resources<DD><CODE>form</CODE> - the form for which the actions are requested |
| <DT><B>Returns:</B><DD>A sorted List of ValidatorAction objects.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascriptBegin(java.lang.String)"><!-- --></A><H3>
|
| getJavascriptBegin</H3>
|
| <PRE>
|
| protected java.lang.String <B>getJavascriptBegin</B>(java.lang.String methods)</PRE>
|
| <DL>
|
| <DD>Returns the opening script element and some initial javascript.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>methods</CODE> - javascript validation methods |
| <DT><B>Returns:</B><DD>the opening script element and some initial javascript</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascriptStaticMethods(org.apache.commons.validator.ValidatorResources)"><!-- --></A><H3>
|
| getJavascriptStaticMethods</H3>
|
| <PRE>
|
| protected java.lang.String <B>getJavascriptStaticMethods</B>(org.apache.commons.validator.ValidatorResources resources)</PRE>
|
| <DL>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>resources</CODE> - the validation resources |
| <DT><B>Returns:</B><DD>the static javascript methods</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getJavascriptEnd()"><!-- --></A><H3>
|
| getJavascriptEnd</H3>
|
| <PRE>
|
| protected java.lang.String <B>getJavascriptEnd</B>()</PRE>
|
| <DL>
|
| <DD>Returns the closing script element.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the closing script element</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getStartElement()"><!-- --></A><H3>
|
| getStartElement</H3>
|
| <PRE>
|
| private java.lang.String <B>getStartElement</B>()</PRE>
|
| <DL>
|
| <DD>Constructs the beginning <script> element depending on xhtml status.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| <DD><DL>
|
| |
| <DT><B>Returns:</B><DD>the beginning <script> element depending on xhtml status</DL>
|
| </DD>
|
| </DL>
|
| <!-- ========= END OF CLASS DATA ========= -->
|
| <HR>
|
|
|
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== -->
|
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
| <TR>
|
| <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
| <TR ALIGN="center" VALIGN="top">
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
| </TR>
|
| </TABLE>
|
| </TD>
|
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
| </EM>
|
| </TD>
|
| </TR>
|
|
|
| <TR>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../org/apache/velocity/tools/struts/TilesTool.html" title="class in org.apache.velocity.tools.struts"><B>PREV CLASS</B></A>
|
| NEXT CLASS</FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
|
| <A HREF="ValidatorTool.html" target="_top"><B>NO FRAMES</B></A>
|
| <SCRIPT type="text/javascript">
|
| <!--
|
| if(window==top) {
|
| document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
| }
|
| //-->
|
| </SCRIPT>
|
| <NOSCRIPT>
|
| <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
| </NOSCRIPT> |
|
|
| </FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
| <HR>
|
| Copyright (c) 2003 Apache Software Foundation
|
| </BODY>
|
| </HTML>
|