Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
BodyTagSupport
org.apache.struts.taglib.html.JavascriptValidatorTag
public class JavascriptValidatorTag
extends BodyTagSupport
ValidatorPlugIn
defined in the struts-config.xml file.
Field Summary | |
protected String |
|
protected String |
|
protected static Locale |
|
protected String |
|
protected String |
|
private String | |
protected String |
|
private String | |
protected static String |
|
protected String |
|
protected int |
|
protected String |
|
protected String |
|
Method Summary | |
int |
|
String |
|
String |
|
String |
|
String |
|
protected String |
|
protected String |
|
protected String |
|
String |
|
private String |
|
int |
|
String |
|
private String |
|
String |
|
private boolean |
|
void |
|
private String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected String bundle
The servlet context attribute key for our resources.
protected String cdata
Hide JavaScript methods in a CDATA section for XHTML when "true".
protected static Locale defaultLocale
Deprecated. This variable is no longer used.
The default locale on our server.
protected String dynamicJavascript
The dynamic JavaScript objects will only be generated if this is set to "true".
protected String formName
The name of the form that corresponds with the action name in struts-config.xml. Specifying a form name places a <script> </script> around the javascript.
private String htmlBeginComment
protected String htmlComment
The JavaScript methods will enclosed with html comments if this is set to "true".
private String htmlEndComment
protected static String lineEnd
The line ending string.
protected String methodName
This will be used as is for the JavaScript validation method name if it has a value. This is the method name of the main JavaScript method that the form calls to perform validations.
protected int page
The current page number of a multi-part form. Only valid when the formName attribute is set.
protected String src
The src attribute for html script element (used to include an external script resource). The src attribute is only recognized when the formName attribute is specified.
protected String staticJavascript
The static JavaScript methods will only be printed if this is set to "true".
public int doStartTag() throws JspException
Render the JavaScript for to perform validations based on the form name.
public String getCdata()
Returns the cdata setting "true" or "false".
- Returns:
- String - "true" if JavaScript will be hidden in a CDATA section
public String getDynamicJavascript()
Gets whether or not to generate the dynamic JavaScript. If this is set to 'true', which is the default, the dynamic JavaScript will be generated.
public String getFormName()
Gets the key (form name) that will be used to retrieve a set of validation rules to be performed on the bean passed in for validation.
public String getHtmlComment()
Gets whether or not to delimit the JavaScript with html comments. If this is set to 'true', which is the default, the htmlComment will be surround the JavaScript.
protected String getJavascriptBegin(String methods)
Returns the opening script element and some initial javascript.
protected String getJavascriptEnd()
Returns the closing script element.
protected String getJavascriptStaticMethods(ValidatorResources resources)
public String getMethod()
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.
private String getNextVar(String input)
The valuenull
will be returned at the end of the sequence. ex: "zz" will returnnull
public int getPage()
Gets the current page number of a multi-part form. Only field validations with a matching page numer will be generated that match the current page number. Only valid when the formName attribute is set.
public String getSrc()
Gets the src attribute's value when defining the html script element.
private String getStartElement()
Constructs the beginning <script> element depending on xhtml status.
public String getStaticJavascript()
Gets whether or not to generate the static JavaScript. If this is set to 'true', which is the default, the static JavaScript will be generated.
private boolean isXhtml()
Returns true if this is an xhtml page.
public void release()
Release any acquired resources.
private String replaceChar(String input, int pos, char c)
Replaces a single character in aString
public void setCdata(String cdata)
Sets the cdata status.
- Parameters:
cdata
- The cdata to set
public void setDynamicJavascript(String dynamicJavascript)
Sets whether or not to generate the dynamic JavaScript. If this is set to 'true', which is the default, the dynamic JavaScript will be generated.
public void setFormName(String formName)
Sets the key (form name) that will be used to retrieve a set of validation rules to be performed on the bean passed in for validation. Specifying a form name places a <script> </script> tag around the javascript.
public void setHtmlComment(String htmlComment)
Sets whether or not to delimit the JavaScript with html comments. If this is set to 'true', which is the default, the htmlComment will be surround the JavaScript.
public void setMethod(String methodName)
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.
public void setPage(int page)
Sets the current page number of a multi-part form. Only field validations with a matching page numer will be generated that match the current page number. Only valid when the formName attribute is set.
public void setSrc(String src)
Sets the src attribute's value when defining the html script element. The src attribute is only recognized when the formName attribute is specified.
public void setStaticJavascript(String staticJavascript)
Sets whether or not to generate the static JavaScript. If this is set to 'true', which is the default, the static JavaScript will be generated.