cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2004-03-08 Thread rleland
rleland 2004/03/08 15:26:58

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Bug 17667 Patch and bug report by Alexander Merk
  Update patch by  Matt Bathje
  This allows multiple forms to be on the same page
  by generating a unique variable name based on form name.
  
  Struts must now be compiled against the nightly validator inorder
  for client side validations to work.
  
  Revision  ChangesPath
  1.48  +7 -5  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JavascriptValidatorTag.java   24 Feb 2004 22:32:54 -  1.47
  +++ JavascriptValidatorTag.java   8 Mar 2004 23:26:58 -   1.48
  @@ -440,6 +440,7 @@
   int jscriptVar = 0;
   String functionName = null;
   
  +
   if (va.getJsFunctionName() != null
va.getJsFunctionName().length()  0) {
   functionName = va.getJsFunctionName();
  @@ -447,7 +448,8 @@
   functionName = va.getName();
   }
   
  -results.append(function  + functionName +  () { \n);
  +String formName = form.getName();
  +results.append(function  + formName + _ + functionName +  () { 
\n);
   for (Iterator x = form.getFields().iterator(); x.hasNext();) {
   Field field = (Field) x.next();
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2004-02-14 Thread husted
husted  2004/02/14 03:11:02

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Apply #26782 JavaScriptValidatorTag produces invalid JavaScript function name when 
form is subclass of ValidatorActionForm submitted by jbelew2002.
  
  Revision  ChangesPath
  1.46  +6 -5  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- JavascriptValidatorTag.java   4 Feb 2004 17:12:01 -   1.45
  +++ JavascriptValidatorTag.java   14 Feb 2004 11:11:02 -  1.46
  @@ -677,7 +677,8 @@
*/
   protected String getJavascriptBegin(String methods) {
   StringBuffer sb = new StringBuffer();
  -String name =
  +String name = formName.replace('/', '_'); // remove any '/' characters
  +name =
   formName.substring(0, 1).toUpperCase()
   + formName.substring(1, formName.length());
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-12-07 Thread dgraham
dgraham 2003/12/07 09:34:51

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Made HTML_* constants protected for PR# 24517.
  
  Revision  ChangesPath
  1.42  +14 -6 
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- JavascriptValidatorTag.java   2 Dec 2003 05:06:34 -   1.41
  +++ JavascriptValidatorTag.java   7 Dec 2003 17:34:51 -   1.42
  @@ -128,9 +128,17 @@
   }
   };
   
  -private static final String HTML_BEGIN_COMMENT = \n!-- Begin \n;
  +/**
  + * The start of the HTML comment hiding JavaScript from old browsers.
  + * @since Struts 1.2
  + */
  +protected static final String HTML_BEGIN_COMMENT = \n!-- Begin \n;
   
  -private static final String HTML_END_COMMENT = //End -- \n;
  +/**
  + * The end of the HTML comment hiding JavaScript from old browsers.
  + * @since Struts 1.2
  + */
  +protected static final String HTML_END_COMMENT = //End -- \n;
   
   // --- Properties
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-12-01 Thread dgraham
dgraham 2003/12/01 21:06:35

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Renamed getStartElement() to renderStartElement() and
  made it protected for PR# 24517.
  
  Revision  ChangesPath
  1.41  +10 -8 
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- JavascriptValidatorTag.java   28 Nov 2003 22:55:36 -  1.40
  +++ JavascriptValidatorTag.java   2 Dec 2003 05:06:34 -   1.41
  @@ -375,7 +375,7 @@
   this.createDynamicJavascript(config, resources, locale, form));
   
   } else if (true.equalsIgnoreCase(staticJavascript)) {
  -results.append(this.getStartElement());
  +results.append(this.renderStartElement());
   if (true.equalsIgnoreCase(htmlComment)) {
   results.append(HTML_BEGIN_COMMENT);
   }
  @@ -645,7 +645,7 @@
   formName.substring(0, 1).toUpperCase()
   + formName.substring(1, formName.length());
   
  -sb.append(this.getStartElement());
  +sb.append(this.renderStartElement());
   
   if (this.isXhtml()  true.equalsIgnoreCase(this.cdata)) {
   sb.append(![CDATA[\r\n);
  @@ -726,9 +726,11 @@
   }
   
   /**
  - * Constructs the beginning lt;scriptgt; element depending on XHTML status.
  + * Constructs the beginning lt;scriptgt; element depending on XHTML 
  + * status.
  + * @since Struts 1.2
*/
  -private String getStartElement() {
  +protected String renderStartElement() {
   StringBuffer start = new StringBuffer(script type=\text/javascript\);
   
   // there is no language attribute in XHTML
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-11-28 Thread dgraham
dgraham 2003/11/28 14:55:36

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Removed getNextVar() and replaceChar() methods and use
  a simpler javascript identifier naming scheme.  All variables
  with be named a0, a1, etc. to prevent using reserved words
  as variable names.  PR# 24516
  
  Revision  ChangesPath
  1.40  +9 -58 
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- JavascriptValidatorTag.java   28 Sep 2003 17:02:51 -  1.39
  +++ JavascriptValidatorTag.java   28 Nov 2003 22:55:36 -  1.40
  @@ -7,7 +7,7 @@
*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -423,7 +423,7 @@
   
   for (Iterator i = actions.iterator(); i.hasNext();) {
   ValidatorAction va = (ValidatorAction) i.next();
  -String jscriptVar = null;
  +int jscriptVar = 0;
   String functionName = null;
   
   if (va.getJsFunctionName() != null
  @@ -450,11 +450,10 @@
   
   message = (message != null) ? message : ;
   
  -jscriptVar = this.getNextVar(jscriptVar);
  -
  +// prefix variable with 'a' to make it a legal identifier
   results.append(
  - this.
  -+ jscriptVar
  + this.a
  ++ jscriptVar++
   +  = new Array(\
   + field.getKey()
   + \, \
  @@ -724,54 +723,6 @@
   sb.append(/script\n\n);
   
   return sb.toString();
  -}
  -
  -/**
  - * The value codenull/code will be returned at the end of the sequence.
  - * nbsp;nbsp;nbsp; ex: zz will return codenull/code
  - */
  -private String getNextVar(String input) {
  -if (input == null) {
  -return aa;
  -}
  -
  -input = input.toLowerCase();
  -
  -for (int i = input.length(); i  0; i--) {
  -int pos = i - 1;
  -
  -char c = input.charAt(pos);
  -c++;
  -
  -if (c = 'z') {
  -if (i == 0) {
  -return c + input.substring(pos, input.length());
  -} else if (i == input.length()) {
  -return input.substring(0, pos) + c;
  -} else {
  -return input.substring(0, pos) + c + input.substring(pos, 
input.length() - 1);
  -}
  -} else {
  -input = replaceChar(input, pos, 'a');
  -}
  -
  -}
  -
  -return null;
  -
  -}
  -
  -/**
  - * Replaces a single character in a codeString/code
  - */
  -private String replaceChar(String input, int pos, char c) {
  -if (pos == 0) {
  -return c + input.substring(pos, input.length());
  -} else if (pos == input.length()) {
  -return input.substring(0, pos) + c;
  -} else {
  -return input.substring(0, pos) + c + input.substring(pos, 
input.length() - 1);
  -}
   }
   
   /**
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-07-28 Thread David Graham
I think we should only place @since tags on methods in the public API
(public and protected).  Placing them on private members will be confusing
if we make those methods accessible in a future release.

David

--- [EMAIL PROTECTED] wrote:
 rleland 2003/07/27 22:54:33
 
   Modified:src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java
   Log:
   Bug 20754, Enhancement to allow checking of all constraints
   instead of aborting. The default  is same as struts 1.1.
   Patch for struts 1.1 RC2 provided by (Marcelo Caldas)
   
   Revision  ChangesPath
   1.36  +29 -10   

jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
   
   Index: JavascriptValidatorTag.java
   ===
   RCS file:

/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
   retrieving revision 1.35
   retrieving revision 1.36
   diff -u -r1.35 -r1.36
   --- JavascriptValidatorTag.java 26 Jul 2003 18:51:35 -  1.35
   +++ JavascriptValidatorTag.java 28 Jul 2003 05:54:33 -  1.36
   @@ -367,7 +367,7 @@
PageContext.APPLICATION_SCOPE);

Locale locale =
 TagUtils.getInstance().getUserLocale(this.pageContext, null);
   -
   +
Form form = resources.get(locale, formName);
if (form != null) {
if (true.equalsIgnoreCase(dynamicJavascript)) {
   @@ -402,6 +402,7 @@
 * @param resources
 * @param locale
 * @param form
   + * @since Struts 1.2
 */
private String createDynamicJavascript(
ModuleConfig config,
   @@ -418,7 +419,15 @@

List actions = this.createActionList(resources, form);

   -   
 results.append(this.getJavascriptBegin(this.createMethods(actions)));
   +Object stopOnErrorObj =
 pageContext.getAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'+
 config.getPrefix(),
   +PageContext.APPLICATION_SCOPE);
   +boolean stopOnError = true;
   +if (stopOnErrorObj != null  (stopOnErrorObj instanceof
 Boolean)) {
   +stopOnError = ((Boolean)stopOnErrorObj).booleanValue();
   +}
   +
   +
   +   

results.append(this.getJavascriptBegin(this.createMethods(actions,stopOnError)));

for (Iterator i = actions.iterator(); i.hasNext();) {
ValidatorAction va = (ValidatorAction) i.next();
   @@ -526,11 +535,18 @@
/**
 * Creates the JavaScript methods list from the given actions.
 * @param actions A List of ValidatorAction objects.
   + * @param stopOnError If true, behaves like released version of
 struts 1.1
   + *and stops after first error. If false, evaluates all
 validations.
 * @return JavaScript methods.
   + * @since Struts 1.2
 */
   -private String createMethods(List actions) {
   +private String createMethods(List actions, boolean stopOnError) {
String methods = null;
   -
   +String methodOperator =   ;
   +if (!stopOnError) {
   +methodOperator=   ;
   +}
   +
Iterator iter = actions.iterator();
while (iter.hasNext()) {
ValidatorAction va = (ValidatorAction) iter.next();
   @@ -538,7 +554,7 @@
if (methods == null) {
methods = va.getMethod() + (form);
} else {
   -methods +=+ va.getMethod() + (form);
   +methods += methodOperator + va.getMethod() +
 (form);
}
}

   @@ -651,7 +667,10 @@
if (methods == null || methods.length() == 0) {
sb.append(   return true; \n);
} else {
   -sb.append(   return  + methods + ; \n);
   +//Making Sure that Bitwise operator works:
   +sb.append( var formValidationResult;\n);
   +sb.append(   formValidationResult =  + methods + ;
 \n);
   +sb.append( return (formValidationResult == 1);\n);
}

sb.append(   } \n\n);
   
   
   
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-07-27 Thread rleland
rleland 2003/07/27 22:54:33

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Bug 20754, Enhancement to allow checking of all constraints
  instead of aborting. The default  is same as struts 1.1.
  Patch for struts 1.1 RC2 provided by (Marcelo Caldas)
  
  Revision  ChangesPath
  1.36  +29 -10
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- JavascriptValidatorTag.java   26 Jul 2003 18:51:35 -  1.35
  +++ JavascriptValidatorTag.java   28 Jul 2003 05:54:33 -  1.36
  @@ -367,7 +367,7 @@
   PageContext.APPLICATION_SCOPE);
   
   Locale locale = TagUtils.getInstance().getUserLocale(this.pageContext, 
null);
  -
  +
   Form form = resources.get(locale, formName);
   if (form != null) {
   if (true.equalsIgnoreCase(dynamicJavascript)) {
  @@ -402,6 +402,7 @@
* @param resources
* @param locale
* @param form
  + * @since Struts 1.2
*/
   private String createDynamicJavascript(
   ModuleConfig config,
  @@ -418,7 +419,15 @@
   
   List actions = this.createActionList(resources, form);
   
  -results.append(this.getJavascriptBegin(this.createMethods(actions)));
  +Object stopOnErrorObj = 
pageContext.getAttribute(ValidatorPlugIn.STOP_ON_ERROR_KEY + '.'+ config.getPrefix(),
  +PageContext.APPLICATION_SCOPE);
  +boolean stopOnError = true;
  +if (stopOnErrorObj != null  (stopOnErrorObj instanceof Boolean)) {
  +stopOnError = ((Boolean)stopOnErrorObj).booleanValue();
  +}
  +
  +
  +
results.append(this.getJavascriptBegin(this.createMethods(actions,stopOnError)));
   
   for (Iterator i = actions.iterator(); i.hasNext();) {
   ValidatorAction va = (ValidatorAction) i.next();
  @@ -526,11 +535,18 @@
   /**
* Creates the JavaScript methods list from the given actions.
* @param actions A List of ValidatorAction objects.
  + * @param stopOnError If true, behaves like released version of struts 1.1
  + *and stops after first error. If false, evaluates all validations.
* @return JavaScript methods.
  + * @since Struts 1.2
*/
  -private String createMethods(List actions) {
  +private String createMethods(List actions, boolean stopOnError) {
   String methods = null;
  -
  +String methodOperator =   ;
  +if (!stopOnError) {
  +methodOperator=   ;
  +}
  +
   Iterator iter = actions.iterator();
   while (iter.hasNext()) {
   ValidatorAction va = (ValidatorAction) iter.next();
  @@ -538,7 +554,7 @@
   if (methods == null) {
   methods = va.getMethod() + (form);
   } else {
  -methods +=+ va.getMethod() + (form);
  +methods += methodOperator + va.getMethod() + (form);
   }
   }
   
  @@ -651,7 +667,10 @@
   if (methods == null || methods.length() == 0) {
   sb.append(   return true; \n);
   } else {
  -sb.append(   return  + methods + ; \n);
  +//Making Sure that Bitwise operator works:
  +sb.append( var formValidationResult;\n);
  +sb.append(   formValidationResult =  + methods + ; \n);
  +sb.append( return (formValidationResult == 1);\n);
   }
   
   sb.append(   } \n\n);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-07-25 Thread dgraham
dgraham 2003/07/25 16:46:27

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Refactored doStartTag into several smaller methods.
  
  Revision  ChangesPath
  1.32  +254 -204  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- JavascriptValidatorTag.java   8 Jul 2003 00:05:10 -   1.31
  +++ JavascriptValidatorTag.java   25 Jul 2003 23:46:27 -  1.32
  @@ -93,10 +93,40 @@
* defined in the struts-config.xml file.
*
* @author David Winterfeldt
  + * @author David Graham
* @version $Revision$ $Date$
* @since Struts 1.1
*/
   public class JavascriptValidatorTag extends BodyTagSupport {
  +
  +/**
  + * A Comparator to use when sorting ValidatorAction objects.
  + */
  +private static final Comparator actionComparator = new Comparator() {
  +public int compare(Object o1, Object o2) {
  +
  +ValidatorAction va1 = (ValidatorAction) o1;
  +ValidatorAction va2 = (ValidatorAction) o2;
  +
  +if ((va1.getDepends() == null || va1.getDepends().length() == 0)
  + (va2.getDepends() == null || va2.getDepends().length() == 0)) {
  +return 0;
  +
  +} else if (
  +(va1.getDepends() != null  va1.getDepends().length()  0)
  + (va2.getDepends() == null || va2.getDepends().length() == 
0)) {
  +return 1;
  +
  +} else if (
  +(va1.getDepends() == null || va1.getDepends().length() == 0)
  + (va2.getDepends() != null  va2.getDepends().length()  0)) 
{
  +return -1;
  +
  +} else {
  +return va1.getDependencies().size() - va2.getDependencies().size();
  +}
  +}
  +};
   
   private static final String HTML_BEGIN_COMMENT = \n!-- Begin \n;
   
  @@ -310,240 +340,260 @@
* @exception JspException if a JSP exception has occurred
*/
   public int doStartTag() throws JspException {
  -StringBuffer results = new StringBuffer();
   
  +JspWriter writer = pageContext.getOut();
  +try {
  +writer.print(this.renderJavascript());
  +
  +} catch (IOException e) {
  +throw new JspException(e.getMessage());
  +}
  +
  +return EVAL_BODY_TAG;
  +
  +}
  +
  +/**
  + * Returns fully rendered JavaScript. 
  + * @since Struts 1.2
  + */
  +protected String renderJavascript() {
  +StringBuffer results = new StringBuffer();
  +
   ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
   ValidatorResources resources =
   (ValidatorResources) pageContext.getAttribute(
   ValidatorPlugIn.VALIDATOR_KEY + config.getPrefix(),
   PageContext.APPLICATION_SCOPE);
  -
  +
   Locale locale = RequestUtils.retrieveUserLocale(this.pageContext, null);
  -
  +
   Form form = resources.get(locale, formName);
   if (form != null) {
   if (true.equalsIgnoreCase(dynamicJavascript)) {
  -MessageResources messages =
  -(MessageResources) pageContext.getAttribute(
  -bundle + config.getPrefix(),
  -PageContext.APPLICATION_SCOPE);
  -
  -List actions = new ArrayList();
  -List actionMethods = new ArrayList();
  -
  -// Get List of actions for this Form
  -for (Iterator i = form.getFields().iterator(); i.hasNext();) {
  -Field field = (Field) i.next();
  -
  -for (Iterator x = field.getDependencies().iterator(); 
x.hasNext();) {
  -Object o = x.next();
  -
  -if (o != null  !actionMethods.contains(o)) {
  -actionMethods.add(o);
  -}
  -}
  -
  +results.append(
  +this.createDynamicJavascript(config, resources, locale, form));
  +
  +} else if (true.equalsIgnoreCase(staticJavascript)) {
  +results.append(this.getStartElement());
  +if (true.equalsIgnoreCase(htmlComment)) {
  +results.append(HTML_BEGIN_COMMENT);
   }
  -
  -// Create list of ValidatorActions based on lActionMethods
  -for (Iterator i = actionMethods.iterator(); 

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-07-07 Thread dgraham
dgraham 2003/07/07 16:46:35

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Turned the htmlBeginComment and htmlEndComment into constants 
  because they should never change.
  
  Revision  ChangesPath
  1.30  +11 -11
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- JavascriptValidatorTag.java   2 Jul 2003 03:47:23 -   1.29
  +++ JavascriptValidatorTag.java   7 Jul 2003 23:46:35 -   1.30
  @@ -98,6 +98,10 @@
*/
   public class JavascriptValidatorTag extends BodyTagSupport {
   
  +private static final String HTML_BEGIN_COMMENT = \n!-- Begin \n;
  +
  +private static final String HTML_END_COMMENT = //End -- \n;
  +
   // --- Properties
   
   /**
  @@ -161,10 +165,6 @@
* Hide JavaScript methods in a CDATA section for XHTML when true.
*/
   protected String cdata = true;
  -
  -private String htmlBeginComment = \n!-- Begin \n;
  -
  -private String htmlEndComment = //End -- \n;
   
   /**
* Gets the key (form name) that will be used
  @@ -511,7 +511,7 @@
   } else if (true.equalsIgnoreCase(staticJavascript)) {
   results.append(this.getStartElement());
   if (true.equalsIgnoreCase(htmlComment)) {
  -results.append(htmlBeginComment);
  +results.append(HTML_BEGIN_COMMENT);
   }
   }
   }
  @@ -571,7 +571,7 @@
   }
   
   if (!this.isXhtml()  true.equals(htmlComment)) {
  -sb.append(htmlBeginComment);
  +sb.append(HTML_BEGIN_COMMENT);
   }
   sb.append(\n var bCancel = false; \n\n);
   
  @@ -629,7 +629,7 @@
   
   sb.append(\n);
   if (!this.isXhtml()  true.equals(htmlComment)){
  -sb.append(htmlEndComment);
  +sb.append(HTML_END_COMMENT);
   }
   
   if (this.isXhtml()  true.equalsIgnoreCase(this.cdata)) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-04-03 Thread dgraham
dgraham 2003/04/03 22:41:09

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Don't output requiredif field* javascript variables because they're not used
  and break other validations.  PR # 18018.
  
  Revision  ChangesPath
  1.25  +22 -17
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JavascriptValidatorTag.java   10 Mar 2003 01:57:31 -  1.24
  +++ JavascriptValidatorTag.java   4 Apr 2003 06:41:09 -   1.25
  @@ -320,8 +320,7 @@
   locale = defaultLocale;
   }
   
  -Form form = null;
  -form = resources.get(locale, formName);
  +Form form = resources.get(locale, formName);;
   if (form != null) {
   if (true.equals(dynamicJavascript)) {
   MessageResources messages =
  @@ -438,47 +437,52 @@
   
   results.append(new Function (\varName\, \);
   
  -Map hVars = field.getVars();
  +Map vars = field.getVars();
   // Loop through the field's variables.
  -for (Iterator iVars = hVars.keySet().iterator(); 
iVars.hasNext();) {
  -String varKey = (String) iVars.next();
  -Var var = (Var) hVars.get(varKey);
  +for (Iterator varsIterator = vars.keySet().iterator(); 
varsIterator.hasNext();) {
  +String varName = (String) varsIterator.next();
  +Var var = (Var) vars.get(varName);
   String varValue = var.getValue();
   String jsType = var.getJsType();
  +
  +// skip requiredif variables field, fieldIndexed, 
fieldTest, fieldValue
  +if (varName.startsWith(field)){
  +continue;
  +}
   
   if (Var.JSTYPE_INT.equalsIgnoreCase(jsType)) {
   results.append(
   this.
  -+ varKey
  ++ varName
   + =
   + ValidatorUtil.replace(varValue, \\, 
)
   + ; );
   } else if 
(Var.JSTYPE_REGEXP.equalsIgnoreCase(jsType)) {
   results.append(
   this.
  -+ varKey
  ++ varName
   + =/
   + ValidatorUtil.replace(varValue, \\, 
)
   + /; );
   } else if 
(Var.JSTYPE_STRING.equalsIgnoreCase(jsType)) {
   results.append(
   this.
  -+ varKey
  ++ varName
   + ='
   + ValidatorUtil.replace(varValue, \\, 
)
   + '; );
   // So everyone using the latest format doesn't 
need to change their xml files immediately.
  -} else if (mask.equalsIgnoreCase(varKey)) {
  +} else if (mask.equalsIgnoreCase(varName)) {
   results.append(
   this.
  -+ varKey
  ++ varName
   + =/
   + ValidatorUtil.replace(varValue, \\, 
)
   + /; );
   } else {
   results.append(
   this.
  -+ varKey
  ++ varName
   + ='
 

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-01-19 Thread dgraham
dgraham 2003/01/19 22:00:48

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Don't print html comments around script in xhtml mode.
  
  Revision  ChangesPath
  1.22  +9 -9  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JavascriptValidatorTag.java   17 Jan 2003 06:09:17 -  1.21
  +++ JavascriptValidatorTag.java   20 Jan 2003 06:00:48 -  1.22
  @@ -544,22 +544,22 @@
   sb.append(![CDATA[\r\n);
   }
   
  -if (true.equals(htmlComment)) {
  +if (!this.isXhtml()  true.equals(htmlComment)) {
   sb.append(htmlBeginComment);
   }
   sb.append(\n var bCancel = false; \n\n);
   
  -if (methodName == null || methodName.length() == 0)
  +if (methodName == null || methodName.length() == 0) {
   sb.append(
   function validate
   + name
   + (form) { 
  \n);
  -else
  +} else {
   sb.append(
   function 
   + methodName
   + (form) { 
  \n);
  -
  +}
   sb.append(if (bCancel) \n);
   sb.append(  return true; \n);
   sb.append(else \n);
  @@ -601,7 +601,7 @@
   StringBuffer sb = new StringBuffer();
   
   sb.append(\n);
  -if (true.equals(htmlComment)){
  +if (!this.isXhtml()  true.equals(htmlComment)){
   sb.append(htmlEndComment);
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2003-01-15 Thread dgraham
dgraham 2003/01/15 19:55:09

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Removed generation of CDATA section for xhtml.  Using html comments works
  better.
  
  Revision  ChangesPath
  1.20  +4 -11 
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JavascriptValidatorTag.java   8 Dec 2002 06:54:51 -   1.19
  +++ JavascriptValidatorTag.java   16 Jan 2003 03:55:09 -  1.20
  @@ -1,7 +1,7 @@
   /*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -528,12 +528,9 @@
   
   sb.append(this.getStartElement());
   
  -if (this.isXhtml()) {
  -sb.append(![CDATA[\r\n);
  -}
  -
  -if (true.equals(htmlComment))
  +if (true.equals(htmlComment)) {
   sb.append(htmlBeginComment);
  +}
   sb.append(\n var bCancel = false; \n\n);
   
   if (methodName == null || methodName.length() == 0)
  @@ -590,10 +587,6 @@
   sb.append(\n);
   if (true.equals(htmlComment)){
   sb.append(htmlEndComment);
  -}
  -
  - if (this.isXhtml()) {
  -sb.append(]]\r\n);
   }
   
   sb.append(/script\n\n);
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-11-20 Thread dgraham
dgraham 2002/11/20 18:02:16

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Throw a nicer NPE for Bugzilla PR# 14720.
  
  Revision  ChangesPath
  1.18  +11 -2 
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JavascriptValidatorTag.java   20 Nov 2002 05:56:08 -  1.17
  +++ JavascriptValidatorTag.java   21 Nov 2002 02:02:16 -  1.18
  @@ -333,8 +333,17 @@
   
   // Create list of ValidatorActions based on lActionMethods
   for (Iterator i = lActionMethods.iterator(); i.hasNext();) {
  -ValidatorAction va = resources.getValidatorAction((String) 
i.next());
  +String depends = (String) i.next();
  +ValidatorAction va = resources.getValidatorAction(depends);
   
  +// throw nicer NPE for easier debugging
  +if (va == null) {
  +throw new NullPointerException(
  +Depends string \
  ++ depends
  ++ \ was not found in validator-rules.xml.);
  +}   
  +
   String javascript = va.getJavascript();
   if (javascript != null  javascript.length()  0) {
   lActions.add(va);
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-11-11 Thread dgraham
dgraham 2002/11/11 21:59:24

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Fixed bug with extra .
  
  Revision  ChangesPath
  1.15  +7 -8  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JavascriptValidatorTag.java   12 Nov 2002 03:47:42 -  1.14
  +++ JavascriptValidatorTag.java   12 Nov 2002 05:59:24 -  1.15
   -517,12 +517,6 
   
   sb.append(this.getStartElement());
   
  -if (src != null) {
  -sb.append( src=\ + src + \ \n);
  -} else {
  -sb.append( \n);
  -}
  -
   if (true.equals(htmlComment))
   sb.append(htmlBeginComment);
   sb.append(\n var bCancel = false; \n\n);
   -641,7 +635,12 
   if (!BaseHandlerTag.isXhtml(this)) {
   start.append( language=\Javascript1.1\);
   }
  -start.append();
  +
  +if (this.src != null) {
  +start.append( src=\ + src + \);
  +}
  +
  +start.append( \n);
   return start.toString();
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-11-07 Thread rleland
rleland 2002/11/07 21:45:58

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Bug 14054
  Checked in More ApplicationConfig-ModuleConfig
  
  Revision  ChangesPath
  1.13  +3 -3  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JavascriptValidatorTag.java   1 Nov 2002 20:57:16 -   1.12
  +++ JavascriptValidatorTag.java   8 Nov 2002 05:45:58 -   1.13
   -80,7 +80,7 
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.validator.Resources;
   import org.apache.struts.util.RequestUtils;
  -import org.apache.struts.config.ApplicationConfig;
  +import org.apache.struts.config.ModuleConfig;
   
   
   /**
   -292,7 +292,7 
   public int doStartTag() throws JspException {
   StringBuffer results = new StringBuffer();
   
  -ApplicationConfig config = RequestUtils.getModuleConfig(pageContext);
  +ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
   ValidatorResources resources = (ValidatorResources)
   pageContext.getAttribute(ValidatorPlugIn.VALIDATOR_KEY +
   config.getPrefix(), PageContext.APPLICATION_SCOPE);
  
  
  

--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-11-01 Thread ekbush
ekbush  2002/11/01 12:57:16

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Validator was always looking at resources for the default module.  Changed
  lookup so that it is module-relative.
  
  Patch provided by: [EMAIL PROTECTED] (Brian Ely)
  
  PR: 14167
  
  Revision  ChangesPath
  1.12  +3 -2  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JavascriptValidatorTag.java   30 Oct 2002 02:31:10 -  1.11
  +++ JavascriptValidatorTag.java   1 Nov 2002 20:57:16 -   1.12
  @@ -312,7 +312,8 @@
   if (form != null) {
   if (true.equals(dynamicJavascript)) {
   MessageResources messages = (MessageResources)
  -pageContext.getAttribute(bundle, 
PageContext.APPLICATION_SCOPE);
  +pageContext.getAttribute(bundle + config.getPrefix(),
  + PageContext.APPLICATION_SCOPE);
   
   List lActions = new ArrayList();
   List lActionMethods = new ArrayList();
  
  
  

--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-24 Thread rleland
rleland 2002/10/23 23:20:33

  Modified:doc/userGuide struts-html.xml
   src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Bug 11950 reopened by [EMAIL PROTECTED]
  Bug 13836 opened by [EMAIL PROTECTED]
   and reported by [EMAIL PROTECTED]
  changed:
  Bug 11950
  The formName is now again used as a flag
  to indicate that the script/script should be
  included around javascript.
  Bug 13836 - uncovered one condition where
  a //End -- comment could be printed without a
  !-- Begin, which was onlty ehibited by mixing a
  new struts.jar with old validator example code.
  
  Also added htmlComment attribute to indicate
  wheather the html comment should wrap
  the javascript.
  
  Revision  ChangesPath
  1.29  +12 -0 jakarta-struts/doc/userGuide/struts-html.xml
  
  Index: struts-html.xml
  ===
  RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- struts-html.xml   16 Oct 2002 19:51:55 -  1.28
  +++ struts-html.xml   24 Oct 2002 06:20:33 -  1.29
  @@ -3195,6 +3195,18 @@
  /p
   /info
   /attribute
  +attribute
  +namehtmlComment/name
  +requiredfalse/required
  +rtexprvaluetrue/rtexprvalue
  +info
  +   p
  +  Wheather or not to enclose the javascript
  +  with html comments.
  +  Defaults to codetrue/code.
  +   /p
  +/info
  +/attribute
   
   /tag
   
  
  
  
  1.10  +154 -112  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JavascriptValidatorTag.java   20 Oct 2002 23:17:06 -  1.9
  +++ JavascriptValidatorTag.java   24 Oct 2002 06:20:33 -  1.10
  @@ -111,12 +111,14 @@
   
   /**
* The name of the form that corresponds with the action name
  - * in struts-config.xml.
  + * in struts-config.xml. Specifying a form name places a
  + * lt;scriptgt; lt;/scriptgt; around the javascript.
*/
   protected String formName = null;
   
   /**
* The current page number of a multi-part form.
  + * Only valid when the formName attribute is set.
*/
   protected int page = 0;
   
  @@ -137,11 +139,21 @@
   protected String dynamicJavascript = true;
   
   /**
  - * The src attribute for html script element (used to include an external 
script resource).
  + * 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 src = null;
   
   /**
  + * The JavaScript methods will enclosed with html comments if this is set to 
true.
  + */
  +protected String htmlComment = true;
  +
  +private String htmlBeginComment = \n!-- Begin \n;
  +
  +private String htmlEndComment = //End -- \n;
  +/**
* 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.
  @@ -154,6 +166,8 @@
* 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
  + * lt;scriptgt; lt;/scriptgt; tag around the javascript.
*/
   public void setFormName(String formName) {
   this.formName = formName;
  @@ -163,6 +177,7 @@
* 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 int getPage() {
   return page;
  @@ -172,6 +187,7 @@
* 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 setPage(int page) {
   this.page = page;
  @@ -234,6 +250,24 @@
   }
   
   /**
  +  * 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.
  +  */
  + 

Re: cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-24 Thread David M. Karr
 rleland == rleland  [EMAIL PROTECTED] writes:

rleland   +attribute
rleland   +namehtmlComment/name
rleland   +requiredfalse/required
rleland   +rtexprvaluetrue/rtexprvalue
rleland   +info
rleland   +   p
rleland   +  Wheather or not to enclose the javascript
rleland   +  with html comments.
rleland   +  Defaults to codetrue/code.
rleland   +   /p
rleland   +/info
rleland   +/attribute

I have a request to the group, to make management of Struts-EL a little easier.
Whenever you make a change which adds, deletes, or changes the type of, a
custom tag attribute, could you submit a bug report indicating that the
corresponding tag in Struts-EL needs to change?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org /apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-21 Thread Hajratwala, Nayan (N.)
Just fyi ..the reason older browsers will support:

tagname attribute=value /

and not

tagname attribute=value/

is because in the first instance, the old browsers will simply interpret /
as another attribute that they cannot understand, and therefore skip it.

On a related note, all browsers will display XHTML with no problems (ok,
maybe not mosaic 1.0).  Where they will have a problem is with the CSS that
you use along with it.  CSS support is sketchy in any NS4.x and lower.

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com]
Sent: Monday, October 21, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit:
jakarta-struts/src/share/org /apache/struts/taglib/html
JavascriptValidatorTag.java


I think someone just submitted a patch for xhmtl compliant taglibs.  
However, a brief glance at the patch shows they did this:

input type=text name=blah/

instead of the w3.org recommended:

input type=text name=blah /  (note the space)

I can only assume w3 recommends the space because some browsers don't like 
the other way.

Opera deals with xhtml just fine.  It's my primary browser.

Dave






From: Martin Cooper [EMAIL PROTECTED]
Reply-To: Struts Developers List [EMAIL PROTECTED]
To: 'Struts Developers List' [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org 
/apache/struts/taglib/html JavascriptValidatorTag.java
Date: Mon, 21 Oct 2002 11:57:11 -0700



  -Original Message-
  From: David Graham [mailto:dgraham1980;hotmail.com]
  Sent: Sunday, October 20, 2002 10:48 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [Supported Browsers] cvs commit:
  jakarta-struts/src/share/org/apache/struts/taglib/html
  JavascriptValidatorTag.java
 
 
  I'd like to discuss XHTML compliance again as well.  My
  understanding of it
  is that current browsers are unaffected by reading xhtml
  compliant pages.
  Craig has talked of creating an xhtml tag library similar to the html
  library but I don't think this is necessary.

No, it's not, and the html:html tag already has an 'xhtml' attribute. 
It's
just a question of completing the job. I think there's still a bug in
Bugzilla for this, too. It's something I wanted to get into 1.1, but I have
not had the time, and the bug, I believe, is marked LATER.

 
  Does anyone know of browsers choking on xhtml?  Is there any
  reason the
  current html taglib couldn't be xhtml compliant?

I think that's the goal.

 
  As far as browsers go, I personally don't care about anything
  older than
  Netscape 4.x (even that's pushing it).  I don't know of any
  sites that claim
  to support anything older than that either.  There are
  probably a very small
  number of people supporting older browsers though.

The most likely place we'd run into browser version issues is corporations
which require the use of a specific browser by all employees. I suspect,
though, that most companies have progressed at least to 4.x browsers.

But then there's always Opera, Lynx, et al, to think about.

--
Martin Cooper


 
  Dave
 
 
 
 
 
 
  From: James Mitchell [EMAIL PROTECTED]
  Reply-To: Struts Developers List [EMAIL PROTECTED]
  To: Struts Developers List [EMAIL PROTECTED]
  Subject: RE: [Supported Browsers] cvs commit:
  jakarta-struts/src/share/org/apache/struts/taglib/html
  JavascriptValidatorTag.java
  Date: Sun, 20 Oct 2002 21:53:27 -0400
  
I didn't remove the language attribute in case some
  browsers need it (I
don't know of any though).
  
  On that note, do we have an official list of supported
  browsers and/or
  versions that we can actually test against?  You know, for
  browser issues
  (e.g. JavaScript, HTML tags, XHTML, etc, etc.)
  
  Sorry if I missed that somewhere.
  
  
  
  James Mitchell
  Software Engineer/Struts Evangelist
  http://www.open-tools.org
  
  
  
  
-Original Message-
From: [EMAIL PROTECTED] [mailto:dgraham;apache.org]
Sent: Sunday, October 20, 2002 7:17 PM
To: [EMAIL PROTECTED]
Subject: cvs commit:
jakarta-struts/src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
   
   
dgraham 2002/10/20 16:17:06
   
  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Added type=text/javascript to script tags for xhtml
compliance.  I didn't
  remove the language attribute in case some browsers need it (I
don't know of
  any though).
   
  Revision  ChangesPath
  1.9   +3 -3
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptV
alidatorTag.java
   
  Index: JavascriptValidatorTag.java
   
  ===
  RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/J
avascriptValidatorTag.java,v
  retrieving

RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-21 Thread David Graham
I think someone just submitted a patch for xhmtl compliant taglibs.  
However, a brief glance at the patch shows they did this:

input type=text name=blah/

instead of the w3.org recommended:

input type=text name=blah /  (note the space)

I can only assume w3 recommends the space because some browsers don't like 
the other way.

Opera deals with xhtml just fine.  It's my primary browser.

Dave






From: Martin Cooper [EMAIL PROTECTED]
Reply-To: Struts Developers List [EMAIL PROTECTED]
To: 'Struts Developers List' [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org 
/apache/struts/taglib/html JavascriptValidatorTag.java
Date: Mon, 21 Oct 2002 11:57:11 -0700



 -Original Message-
 From: David Graham [mailto:dgraham1980;hotmail.com]
 Sent: Sunday, October 20, 2002 10:48 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [Supported Browsers] cvs commit:
 jakarta-struts/src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java


 I'd like to discuss XHTML compliance again as well.  My
 understanding of it
 is that current browsers are unaffected by reading xhtml
 compliant pages.
 Craig has talked of creating an xhtml tag library similar to the html
 library but I don't think this is necessary.

No, it's not, and the html:html tag already has an 'xhtml' attribute. 
It's
just a question of completing the job. I think there's still a bug in
Bugzilla for this, too. It's something I wanted to get into 1.1, but I have
not had the time, and the bug, I believe, is marked LATER.


 Does anyone know of browsers choking on xhtml?  Is there any
 reason the
 current html taglib couldn't be xhtml compliant?

I think that's the goal.


 As far as browsers go, I personally don't care about anything
 older than
 Netscape 4.x (even that's pushing it).  I don't know of any
 sites that claim
 to support anything older than that either.  There are
 probably a very small
 number of people supporting older browsers though.

The most likely place we'd run into browser version issues is corporations
which require the use of a specific browser by all employees. I suspect,
though, that most companies have progressed at least to 4.x browsers.

But then there's always Opera, Lynx, et al, to think about.

--
Martin Cooper



 Dave






 From: James Mitchell [EMAIL PROTECTED]
 Reply-To: Struts Developers List [EMAIL PROTECTED]
 To: Struts Developers List [EMAIL PROTECTED]
 Subject: RE: [Supported Browsers] cvs commit:
 jakarta-struts/src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java
 Date: Sun, 20 Oct 2002 21:53:27 -0400
 
   I didn't remove the language attribute in case some
 browsers need it (I
   don't know of any though).
 
 On that note, do we have an official list of supported
 browsers and/or
 versions that we can actually test against?  You know, for
 browser issues
 (e.g. JavaScript, HTML tags, XHTML, etc, etc.)
 
 Sorry if I missed that somewhere.
 
 
 
 James Mitchell
 Software Engineer/Struts Evangelist
 http://www.open-tools.org
 
 
 
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:dgraham;apache.org]
   Sent: Sunday, October 20, 2002 7:17 PM
   To: [EMAIL PROTECTED]
   Subject: cvs commit:
   jakarta-struts/src/share/org/apache/struts/taglib/html
   JavascriptValidatorTag.java
  
  
   dgraham 2002/10/20 16:17:06
  
 Modified:src/share/org/apache/struts/taglib/html
   JavascriptValidatorTag.java
 Log:
 Added type=text/javascript to script tags for xhtml
   compliance.  I didn't
 remove the language attribute in case some browsers need it (I
   don't know of
 any though).
  
 Revision  ChangesPath
 1.9   +3 -3
   jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptV
   alidatorTag.java
  
 Index: JavascriptValidatorTag.java
  
 ===
 RCS file:
   /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/J
   avascriptValidatorTag.java,v
 retrieving revision 1.8
 retrieving revision 1.9
 diff -u -r1.8 -r1.9
 --- JavascriptValidatorTag.java	18 Oct 2002 16:58:10
 -	1.8
 +++ JavascriptValidatorTag.java	20 Oct 2002 23:17:06
 -	1.9
 @@ -394,7 +394,7 @@
  results.append(} \n\n);
  }
  } else if (true.equals(staticJavascript)) {
 -results.append(script
 language=\Javascript1.1\);
 +results.append(script language=\Javascript1.1\
   type=\text/javascript\);
  }
  
  if (true.equals(staticJavascript)) {
 @@ -438,7 +438,7 @@
  StringBuffer sb = new StringBuffer();
  String name = formName.substring(0, 1).toUpperCase() +
   formName.substring(1, formName.length());
  
 -sb.append(script language=\Javascript1.1\);
 +sb.append(script language=\Javascript1.1\
   type=\text/javascript

RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-21 Thread David Graham
Good to know. When I get time I'll update the html tags to include the 
ending /.

David




From: Hajratwala, Nayan (N.) [EMAIL PROTECTED]
Reply-To: Struts Developers List [EMAIL PROTECTED]
To: 'Struts Developers List' [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org 
/apache/struts/taglib/html JavascriptValidatorTag.java
Date: Mon, 21 Oct 2002 16:12:15 -0400

Just fyi ..the reason older browsers will support:

	tagname attribute=value /

and not

	tagname attribute=value/

is because in the first instance, the old browsers will simply interpret 
/
as another attribute that they cannot understand, and therefore skip it.

On a related note, all browsers will display XHTML with no problems (ok,
maybe not mosaic 1.0).  Where they will have a problem is with the CSS that
you use along with it.  CSS support is sketchy in any NS4.x and lower.

---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: David Graham [mailto:dgraham1980;hotmail.com]
Sent: Monday, October 21, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit:
jakarta-struts/src/share/org /apache/struts/taglib/html
JavascriptValidatorTag.java


I think someone just submitted a patch for xhmtl compliant taglibs.
However, a brief glance at the patch shows they did this:

input type=text name=blah/

instead of the w3.org recommended:

input type=text name=blah /  (note the space)

I can only assume w3 recommends the space because some browsers don't like
the other way.

Opera deals with xhtml just fine.  It's my primary browser.

Dave






From: Martin Cooper [EMAIL PROTECTED]
Reply-To: Struts Developers List [EMAIL PROTECTED]
To: 'Struts Developers List' [EMAIL PROTECTED]
Subject: RE: [Supported Browsers] cvs commit: 
jakarta-struts/src/share/org
/apache/struts/taglib/html JavascriptValidatorTag.java
Date: Mon, 21 Oct 2002 11:57:11 -0700



  -Original Message-
  From: David Graham [mailto:dgraham1980;hotmail.com]
  Sent: Sunday, October 20, 2002 10:48 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [Supported Browsers] cvs commit:
  jakarta-struts/src/share/org/apache/struts/taglib/html
  JavascriptValidatorTag.java
 
 
  I'd like to discuss XHTML compliance again as well.  My
  understanding of it
  is that current browsers are unaffected by reading xhtml
  compliant pages.
  Craig has talked of creating an xhtml tag library similar to the html
  library but I don't think this is necessary.

No, it's not, and the html:html tag already has an 'xhtml' attribute.
It's
just a question of completing the job. I think there's still a bug in
Bugzilla for this, too. It's something I wanted to get into 1.1, but I 
have
not had the time, and the bug, I believe, is marked LATER.

 
  Does anyone know of browsers choking on xhtml?  Is there any
  reason the
  current html taglib couldn't be xhtml compliant?

I think that's the goal.

 
  As far as browsers go, I personally don't care about anything
  older than
  Netscape 4.x (even that's pushing it).  I don't know of any
  sites that claim
  to support anything older than that either.  There are
  probably a very small
  number of people supporting older browsers though.

The most likely place we'd run into browser version issues is 
corporations
which require the use of a specific browser by all employees. I suspect,
though, that most companies have progressed at least to 4.x browsers.

But then there's always Opera, Lynx, et al, to think about.

--
Martin Cooper


 
  Dave
 
 
 
 
 
 
  From: James Mitchell [EMAIL PROTECTED]
  Reply-To: Struts Developers List [EMAIL PROTECTED]
  To: Struts Developers List [EMAIL PROTECTED]
  Subject: RE: [Supported Browsers] cvs commit:
  jakarta-struts/src/share/org/apache/struts/taglib/html
  JavascriptValidatorTag.java
  Date: Sun, 20 Oct 2002 21:53:27 -0400
  
I didn't remove the language attribute in case some
  browsers need it (I
don't know of any though).
  
  On that note, do we have an official list of supported
  browsers and/or
  versions that we can actually test against?  You know, for
  browser issues
  (e.g. JavaScript, HTML tags, XHTML, etc, etc.)
  
  Sorry if I missed that somewhere.
  
  
  
  James Mitchell
  Software Engineer/Struts Evangelist
  http://www.open-tools.org
  
  
  
  
-Original Message-
From: [EMAIL PROTECTED] [mailto:dgraham;apache.org]
Sent: Sunday, October 20, 2002 7:17 PM
To: [EMAIL PROTECTED]
Subject: cvs commit:
jakarta-struts/src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
   
   
dgraham 2002/10/20 16:17:06
   
  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Added type=text/javascript to script tags for xhtml
compliance.  I didn't
  remove the language attribute in case some browsers need it (I
don't know of
  any though

Re: RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-21 Thread Ted Husted
We really try to support the specification rather than the browsers. For tags, we can 
support the 
specifications, period, since they are well enough defined. 

Ideally, I'm sure we'd like to apply the same standard to JavaScript (or maybe 
ECMAScript?), but there does tend 
to be more gray space in that arena. . 

I'd hesitate to say that we support this browser or that browser, since that might 
start us down a slipperly 
slope. Officially, I think we should only cite formal specifications and never 
vendor-specfic instances.

-Ted.

10/20/2002 9:53:27 PM, James Mitchell [EMAIL PROTECTED] wrote:

 I didn't remove the language attribute in case some browsers need it (I
 don't know of any though).

On that note, do we have an official list of supported browsers and/or
versions that we can actually test against?  You know, for browser issues
(e.g. JavaScript, HTML tags, XHTML, etc, etc.)

Sorry if I missed that somewhere.



James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:dgraham;apache.org]
 Sent: Sunday, October 20, 2002 7:17 PM
 To: [EMAIL PROTECTED]
 Subject: cvs commit:
 jakarta-struts/src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java


 dgraham 2002/10/20 16:17:06

   Modified:src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java
   Log:
   Added type=text/javascript to script tags for xhtml
 compliance.  I didn't
   remove the language attribute in case some browsers need it (I
 don't know of
   any though).

   Revision  ChangesPath
   1.9   +3 -3
 jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptV
 alidatorTag.java

   Index: JavascriptValidatorTag.java
   ===
   RCS file:
 /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/J
 avascriptValidatorTag.java,v
   retrieving revision 1.8
   retrieving revision 1.9
   diff -u -r1.8 -r1.9
   --- JavascriptValidatorTag.java18 Oct 2002 16:58:10 -  1.8
   +++ JavascriptValidatorTag.java20 Oct 2002 23:17:06 -  1.9
   @@ -394,7 +394,7 @@
results.append(} \n\n);
}
} else if (true.equals(staticJavascript)) {
   -results.append(script language=\Javascript1.1\);
   +results.append(script language=\Javascript1.1\
 type=\text/javascript\);
}

if (true.equals(staticJavascript)) {
   @@ -438,7 +438,7 @@
StringBuffer sb = new StringBuffer();
String name = formName.substring(0, 1).toUpperCase() +
 formName.substring(1, formName.length());

   -sb.append(script language=\Javascript1.1\);
   +sb.append(script language=\Javascript1.1\
 type=\text/javascript\);

if (src != null) {
sb.append( src=\ + src + \ \n);




 --
 To unsubscribe, e-mail:
 mailto:struts-dev-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-dev-help;jakarta.apache.org




--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org






--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-20 Thread dgraham
dgraham 2002/10/20 16:17:06

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Added type=text/javascript to script tags for xhtml compliance.  I didn't
  remove the language attribute in case some browsers need it (I don't know of
  any though).
  
  Revision  ChangesPath
  1.9   +3 -3  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JavascriptValidatorTag.java   18 Oct 2002 16:58:10 -  1.8
  +++ JavascriptValidatorTag.java   20 Oct 2002 23:17:06 -  1.9
   -394,7 +394,7 
   results.append(} \n\n);
   }
   } else if (true.equals(staticJavascript)) {
  -results.append(script language=\Javascript1.1\);
  +results.append(script language=\Javascript1.1\ 
type=\text/javascript\);
   }
   
   if (true.equals(staticJavascript)) {
   -438,7 +438,7 
   StringBuffer sb = new StringBuffer();
   String name = formName.substring(0, 1).toUpperCase() + 
formName.substring(1, formName.length());
   
  -sb.append(script language=\Javascript1.1\);
  +sb.append(script language=\Javascript1.1\ type=\text/javascript\);
   
   if (src != null) {
   sb.append( src=\ + src + \ \n);
  
  
  

--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




RE: [Supported Browsers] cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-20 Thread James Mitchell
 I didn't remove the language attribute in case some browsers need it (I
 don't know of any though).

On that note, do we have an official list of supported browsers and/or
versions that we can actually test against?  You know, for browser issues
(e.g. JavaScript, HTML tags, XHTML, etc, etc.)

Sorry if I missed that somewhere.



James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:dgraham;apache.org]
 Sent: Sunday, October 20, 2002 7:17 PM
 To: [EMAIL PROTECTED]
 Subject: cvs commit:
 jakarta-struts/src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java


 dgraham 2002/10/20 16:17:06

   Modified:src/share/org/apache/struts/taglib/html
 JavascriptValidatorTag.java
   Log:
   Added type=text/javascript to script tags for xhtml
 compliance.  I didn't
   remove the language attribute in case some browsers need it (I
 don't know of
   any though).

   Revision  ChangesPath
   1.9   +3 -3
 jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptV
 alidatorTag.java

   Index: JavascriptValidatorTag.java
   ===
   RCS file:
 /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/J
 avascriptValidatorTag.java,v
   retrieving revision 1.8
   retrieving revision 1.9
   diff -u -r1.8 -r1.9
   --- JavascriptValidatorTag.java 18 Oct 2002 16:58:10 -  1.8
   +++ JavascriptValidatorTag.java 20 Oct 2002 23:17:06 -  1.9
   @@ -394,7 +394,7 @@
results.append(} \n\n);
}
} else if (true.equals(staticJavascript)) {
   -results.append(script language=\Javascript1.1\);
   +results.append(script language=\Javascript1.1\
 type=\text/javascript\);
}

if (true.equals(staticJavascript)) {
   @@ -438,7 +438,7 @@
StringBuffer sb = new StringBuffer();
String name = formName.substring(0, 1).toUpperCase() +
 formName.substring(1, formName.length());

   -sb.append(script language=\Javascript1.1\);
   +sb.append(script language=\Javascript1.1\
 type=\text/javascript\);

if (src != null) {
sb.append( src=\ + src + \ \n);




 --
 To unsubscribe, e-mail:
 mailto:struts-dev-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-dev-help;jakarta.apache.org




--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-10-16 Thread rleland

rleland 2002/10/16 13:55:07

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Good catch
  Bug #11950. patch suggested by
  [EMAIL PROTECTED] (Balakrishna Shetty)
  I also had to supply a closing /script !
  Tested under TC 4.0.6
  
  Revision  ChangesPath
  1.6   +265 -264  
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JavascriptValidatorTag.java   11 Oct 2002 22:17:50 -  1.5
  +++ JavascriptValidatorTag.java   16 Oct 2002 20:55:07 -  1.6
  @@ -80,7 +80,6 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.StrutsValidatorUtil;
   import org.apache.struts.util.RequestUtils;
  -import org.apache.struts.Globals;
   import org.apache.struts.config.ApplicationConfig;
   
   
  @@ -92,7 +91,7 @@
* @author David Winterfeldt
* @version $Revision$ $Date$
* @since Struts 1.1
  -*/
  + */
   public class JavascriptValidatorTag extends BodyTagSupport {
   
   
  @@ -101,81 +100,81 @@
   
   /**
* The servlet context attribute key for our resources.
  -*/
  + */
   protected String bundle = Action.MESSAGES_KEY;
   
   
   /**
* The default locale on our server.
  -*/
  + */
   protected static Locale defaultLocale = Locale.getDefault();
   
   /**
* The name of the form that corresponds with the action name
* in struts-config.xml.
  -*/
  + */
   protected String formName = null;
   
   /**
* The current page number of a multi-part form.
  -*/
  + */
   protected int page = 0;
   
   /**
* 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 String methodName = null;
   
   /**
* The static JavaScript methods will only be printed if this is set to true.
  -*/
  + */
   protected String staticJavascript = true;
   
   /**
* The dynamic JavaScript objects will only be generated if this is set to 
true.
  -*/
  + */
   protected String dynamicJavascript = true;
   
   /**
* The src attribute for html script element (used to include an external 
script resource).
  -*/
  + */
   protected String src = null;
   
   /**
* 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 getFormName() {
  -   return formName;
  +return 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.
  -*/
  + */
   public void setFormName(String formName) {
  -   this.formName = formName;
  +this.formName = formName;
   }
   
   /**
* 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.
  -*/
  + */
   public int getPage() {
  -   return page;
  +return 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.
  -*/
  + */
   public void setPage(int page) {
  -   this.page = page;
  +this.page = page;
   }
   
   /**
  @@ -183,9 +182,9 @@
* validation method name if it has a value.  This overrides
* the auto-generated method name based on the key (form name)
* passed in.
  -*/
  + */
   public String getMethod() {
  -   return methodName;
  +return methodName;
   }
   
   /**
  @@ -193,228 +192,229 @@
* 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 setMethod(String methodName) {
  -   this.methodName = methodName;
  +this.methodName = methodName;
   }
   
   /**
* 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.
  -*/
  + */
   public String getStaticJavascript() {
  -  

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html JavascriptValidatorTag.java

2002-03-17 Thread dwinterfeldt

dwinterfeldt02/03/17 18:06:41

  Modified:src/share/org/apache/struts/taglib/html
JavascriptValidatorTag.java
  Log:
  Updated javadoc comments.
  
  Revision  ChangesPath
  1.2   +83 -23
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
  
  Index: JavascriptValidatorTag.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavascriptValidatorTag.java   18 Mar 2002 01:42:51 -  1.1
  +++ JavascriptValidatorTag.java   18 Mar 2002 02:06:41 -  1.2
  @@ -81,8 +81,9 @@
   
   
   /**
  - * Custom tag that generates Javascript for client side validation based 
  - * on the validation.xml file.
  + * Custom tag that generates JavaScript for client side validation based 
  + * on the validation rules loaded by the codeValidatorPlugIn/code 
  + * defined in the struts-config.xml file.
*
* @since 1.1
* @author David Winterfeldt
  @@ -95,32 +96,29 @@
   
   /**
* The servlet context attribute key for our resources.
  - */
  +*/
   protected String bundle = Action.MESSAGES_KEY;
   
   
   /**
* The default locale on our server.
  - */
  +*/
   protected static Locale defaultLocale = Locale.getDefault();
   
   /**
* The name of the form that corresponds with the action name 
  - * in struts-config.xml.  This won't be needed if this is incorporated
  - * as an option in the html:form tag (ex: javascript=true).
  - */
  + * in struts-config.xml.
  +*/
   protected String formName = null;
   
   /**
  - * The page number we are on in a multi-part form.  This won't be needed 
  - * if this is incorporated as an option in the html:form tag (should be able to 
be set 
  - * or retrieved from scope).
  + * The current page number of a multi-part form. 
   */
   protected int page = 0;
   
   /**
  - * 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.
  + * 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 String methodName = null;
   
  @@ -139,50 +137,110 @@
   */
   protected String src = null;
   
  +/**
  + * 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 getFormName() {
  return 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.
  +*/
   public void setFormName(String formName) {
  this.formName = formName;
   }
  -
  +
  +/**
  + * 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.
  +*/
   public int getPage() {
  return 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.
  +*/
   public void setPage(int page) {
  this.page = page;
   }
   
  +/**
  + * 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.
  +*/
   public String getMethod() {
  return 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 setMethod(String methodName) {
  this.methodName = methodName;
   }
   
  +/**
  + * 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.
  +*/
   public String getStaticJavascript() {
  return staticJavascript;  
   }
  -
  +
  +/**
  + * Sets whether or not to generate the static 
  + * JavaScript.  If this is set to 'true', which 
  + * is the default, the