org.springmodules.validation.valang.javascript.taglib
Class ValangCodebaseTag

java.lang.Object
  extended by RequestContextAwareTag
      extended by org.springmodules.validation.valang.javascript.taglib.ValangCodebaseTag

public class ValangCodebaseTag
extends RequestContextAwareTag

Generates the JavaScript codebase that is necessary for the use of the JavaScript validation produced by ValangValidateTag.

The generated codebase is an exact copy of the code from the file "valang_codebase.js" located in org.springmodules.validation.valang.javascript. You can therefor avoid having to use this tag by simply placing this file on your web server and linking to it using a the following HTML:

 
 <script type="text/javascript" src="/somepath/valang_codebase.js"></script>
 

When using this tag or the HTML above you must make sure that the codebase is included before any ValangValidateTags in you JSP file.

Author:
Oliver Hutchison

Constructor Summary
ValangCodebaseTag()
           
 
Method Summary
 int doEndTag()
           
 void doFinally()
           
protected  int doStartTagInternal()
           
 void setFieldErrorsIdSuffix(java.lang.String fieldErrorsIdSuffix)
          Sets the id suffix of the element that should hold the error of a specific field.
 void setGlobalErrorsId(java.lang.String globalErrorsId)
          Sets the id of the element that will hold the global error.
 void setIncludeScriptTags(java.lang.String includeScriptTags)
          Sets whether or not the generated code should be wrapped in HTML <script> tags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValangCodebaseTag

public ValangCodebaseTag()
Method Detail

setIncludeScriptTags

public void setIncludeScriptTags(java.lang.String includeScriptTags)
Sets whether or not the generated code should be wrapped in HTML <script> tags. This is useful if you wont to include the codebase directly in a HTML page.


setGlobalErrorsId

public void setGlobalErrorsId(java.lang.String globalErrorsId)
Sets the id of the element that will hold the global error. If not set, this tag will look for an element with id "global_errors".

Parameters:
globalErrorsId - The id of the element that should hold the global errors.

setFieldErrorsIdSuffix

public void setFieldErrorsIdSuffix(java.lang.String fieldErrorsIdSuffix)
Sets the id suffix of the element that should hold the error of a specific field. For example, if the validated field is "firstName" and the suffix is set to "_err" then this tag will put the validation errors for the firstName field in an element with id "firstName_err". If this suffix is not set, it is set by default to "_error".

Parameters:
fieldErrorsIdSuffix - The id suffix of the element that should hold the error of a specific field.

doStartTagInternal

protected int doStartTagInternal()
                          throws ServletException,
                                 JspException
Throws:
ServletException
JspException

doEndTag

public int doEndTag()
             throws JspException
Throws:
JspException

doFinally

public void doFinally()


Copyright © 2005. All Rights Reserved.