Unit Tests

2001-10-17 Thread Adam Grohs



Has anyone been able to get the unit tests running 
on the live src?? If anyone has them working I would appreciate some 
assistance. I get the following errors, any thoughts, should I post this 
to the users list??

run.test: [junit] Running 
org.apache.struts.taglib.logic.TestEqualTag [java] 
StandardWrapperValve[JspRedirector]: Servlet.service() for servlet JspRedirector 
threw exception [java] 
org.apache.jasper.JasperException: Unable to compile class for 
JSP [java] [java] An 
error occurred at line: 1 in the jsp file: 
/test/redirector.jsp 
[java] [java] Generated servlet 
error: [java] 
D:\jakarta\jakarta-tomcat-4.0.1\work\localhost\test\test\redirector$jsp.java:55: 
Class org.apache.jsp.JspTestCaller not found. 
[java] 
JspTestCaller caller = new JspTestCaller();JspImplicitObjects objects = new 
JspImplicitObjects();objects.m_Config = config;objects.m_Request = 
request;objects.m_Response = response;objects.m_PageContext = 
pageContext;objects.m_JspWriter = 
out;caller.doTest(objects); 
[java] 
^ [java] 
[java] [java] An error occurred at line: 1 in the 
jsp file: /test/redirector.jsp

Thanks,
Adam S. Grohs


cvs commit: jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation Field.java Validator.java ValidatorResources.java

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 23:03:32

  Modified:contrib/validator/src/share/com/wintecinc/struts/validation
Field.java Validator.java ValidatorResources.java
  Log:
  When indexed property support was added, it broke the cloning of non-default loccale 
FormSets.  The getKey method in Field was returning null because the Field's process 
method hadn't been called yet.
  
  Revision  ChangesPath
  1.5   +36 -14
jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/Field.java
  
  Index: Field.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/Field.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Field.java2001/09/25 21:23:56 1.4
  +++ Field.java2001/10/18 06:03:32 1.5
  @@ -393,6 +393,9 @@
* Gets a unique key based on the property and indexedProperty fields.
   */
   public String getKey() {
  +   if (key == null)
  +  generateKey();
  +  
  return key;
   }
   
  @@ -415,8 +418,18 @@
  else
 return false;
   }
  -
  +
   /**
  + * Generate correct codekey/code value.
  +*/
  +public void generateKey() {
  +   if (isIndexed())
  +  key = indexedProperty + TOKEN_INDEXED + . + property;
  +   else
  +  key = property;
  +}
  +
  +/**
* Replace constants with values in fields and process the depends field 
* to create the dependency codeMap/code.
   */
  @@ -428,13 +441,8 @@
  hArg3.setFast(true);
  hVars.setFast(true);
   
  -   // If the field is indexed, combine property and 
  -   // indexedProperty to make a unique key.
  -   if (isIndexed())
  -  key = indexedProperty + TOKEN_INDEXED + . + property;
  -   else
  -  key = property;
  -   
  +   generateKey();
  +  
  // Process FormSet Constants
  for (Iterator i = constants.keySet().iterator(); i.hasNext(); ) {
 String key = (String)i.next();
  @@ -557,13 +565,22 @@
  try {
  Field field = (Field)super.clone();
   
  +   if (key != null)
  +  field.setKey(new String(key));
  +
  if (property != null)
 field.setProperty(new String(property));
  +
  +   if (indexedProperty != null)
  +  field.setIndexedProperty(new String(indexedProperty));
  +
  +   if (indexedListProperty != null)
  +  field.setIndexedListProperty(new String(indexedListProperty));
  
  if (depends != null)
 field.setDepends(new String(depends));
  -  
  -   // page field taken care of by clone method
  +
  +   // page  fieldOrder should be taken care of by clone method
  
  field.hDependencies = copyFastHashMap(hDependencies);
  field.hVars = copyFastHashMap(hVars);
  @@ -572,7 +589,7 @@
  field.hArg1 = copyFastHashMap(hArg1);
  field.hArg2 = copyFastHashMap(hArg2);
  field.hArg3 = copyFastHashMap(hArg3);
  -
  +
  return field;
  } catch (CloneNotSupportedException e) {
 throw new InternalError(e.toString());
  @@ -610,9 +627,14 @@
   }
   
   public String toString() {
  - String sReturn = \t\tproperty=+ property+ \n +
  -  \t\tdepends=+ depends+ \n;
  - 
  + String sReturn = \t\tkey=  + key+ \n +
  +  \t\tproperty= + property+ \n +
  +  \t\tindexedProperty=  + indexedProperty+ \n +
  +  \t\tindexedListProperty=  + indexedListProperty+ \n +
  +  \t\tdepends=  + depends+ \n +
  +  \t\tpage= + page+ \n +
  +  \t\tfieldOrder=   + fieldOrder+ \n;
  +
if (hVars != null) {
   sReturn += \t\tVars:\n;
   for (Iterator i = hVars.keySet().iterator(); i.hasNext(); ) {
  
  
  
  1.5   +15 -10
jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/Validator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Validator.java2001/09/25 20:08:48 1.4
  +++ Validator.java2001/10/18 06:03:32 1.5
  @@ -209,10 +209,12 @@
   String depend = st.nextToken().trim();
   Object o = hActionsRun.get(depend);
   
  - 

cvs commit: jakarta-struts/contrib/validator/web/jdbc-example jsRegistration.jsp jsRegistrationSearch.jsp multiRegistration1.jsp multiRegistration2.jsp multiRegistrationSearch.jsp registration.jsp registrationSearch.jsp type.jsp

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 23:21:35

  Modified:contrib/validator/web/jdbc-example jsRegistration.jsp
jsRegistrationSearch.jsp multiRegistration1.jsp
multiRegistration2.jsp multiRegistrationSearch.jsp
registration.jsp registrationSearch.jsp type.jsp
  Log:
  Updated to use html:messages and html:messagesPresent for errors instead of the 
Validator Tags which are now deprecated.
  
  Revision  ChangesPath
  1.2   +4 -4  
jakarta-struts/contrib/validator/web/jdbc-example/jsRegistration.jsp
  
  Index: jsRegistration.jsp
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/jdbc-example/jsRegistration.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jsRegistration.jsp2001/07/09 02:31:04 1.1
  +++ jsRegistration.jsp2001/10/18 06:21:35 1.2
  @@ -14,14 +14,14 @@
 template:put name='main'
 font size=+2bean:message key=jsRegistrationForm.title//fontBRBR
 
  -  validator:errorsExist
  +  logic:messagesPresent
bean:message key=errors.header/
ul
  - validator:errors id=error
  + html:messages id=error
   libean:write name=error//li
  - /validator:errors
  + /html:messages
/ulhr
  -  /validator:errorsExist
  +  /logic:messagesPresent
 
 
 validator:messagesExist
  
  
  
  1.2   +4 -4  
jakarta-struts/contrib/validator/web/jdbc-example/jsRegistrationSearch.jsp
  
  Index: jsRegistrationSearch.jsp
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/jdbc-example/jsRegistrationSearch.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jsRegistrationSearch.jsp  2001/07/09 02:31:04 1.1
  +++ jsRegistrationSearch.jsp  2001/10/18 06:21:35 1.2
  @@ -12,14 +12,14 @@
 template:put name='sidebar' content='/WEB-INF/templates/sidebar.jsp' /
 template:put name='main'
font size=+2bean:message 
key=jsRegistrationForm.title.search//fontBRBR
  -  validator:errorsExist
  +  logic:messagesPresent
bean:message key=errors.header/
ul
  - validator:errors id=error
  + html:messages id=error
   libean:write name=error//li
  - /validator:errors
  + /html:messages
/ulhr
  -  /validator:errorsExist
  +  /logic:messagesPresent
 
 
 validator:messagesExist
  
  
  
  1.2   +4 -4  
jakarta-struts/contrib/validator/web/jdbc-example/multiRegistration1.jsp
  
  Index: multiRegistration1.jsp
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/jdbc-example/multiRegistration1.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- multiRegistration1.jsp2001/07/09 02:31:04 1.1
  +++ multiRegistration1.jsp2001/10/18 06:21:35 1.2
  @@ -14,14 +14,14 @@
 template:put name='main'
font size=+2bean:message key=multiRegistrationForm.title//fontBRBR

  - validator:errorsExist
  + logic:messagesPresent
   bean:message key=errors.header/
   ul
  -validator:errors id=error
  +html:messages id=error
  libean:write name=error//li
  -/validator:errors
  +/html:messages
   /ulhr
  - /validator:errorsExist
  + /logic:messagesPresent


html:form action=multiRegistration onsubmit=return 
validateMultiRegistrationForm(this);
  
  
  
  1.2   +4 -4  
jakarta-struts/contrib/validator/web/jdbc-example/multiRegistration2.jsp
  
  Index: multiRegistration2.jsp
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/jdbc-example/multiRegistration2.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- multiRegistration2.jsp2001/07/09 02:31:04 1.1
  +++ multiRegistration2.jsp2001/10/18 06:21:35 1.2
  @@ -14,14 +14,14 @@
 template:put name='main'
font size=+2bean:message key=multiRegistrationForm.title//fontBRBR

  - validator:errorsExist
  + logic:messagesPresent
   bean:message key=errors.header/
   ul
  -validator:errors id=error
  +html:messages id=error
  libean:write name=error//li
  -/validator:errors
  +/html:messages
   /ulhr
  - /validator:errorsExist
  + /logic:messagesPresent

html:form action=multiRegistration onsubmit=return 
validateMultiRegistrationForm(this);
  html:hidden property=action/
  
  
  
  1.2   +4 -4  

Re: form action problem

2001-10-17 Thread Yokota Takehiko

On Wed, 17 Oct 2001 08:11:39 +0100
Mike Dewhirst [EMAIL PROTECTED] wrote:

 We have a problem where struts is replacing form action URI's with the
 Weblogic application name, but we want to be able to specify (override) the
 URI ourselves. How is this possible?

I had the same problem, and I found it was very difficult.

--
  YOKOTA Takehiko




Bad Resource Links

2001-10-17 Thread David Winterfeldt

Ted, 

I just wanted to mention that any of the resource
links to http://husted.com/about/struts are bad since
everything was moved to http://husted.com/struts, but
even if you take out the about from the url it still
does't go to the resource.

http://jakarta.apache.org/struts/userGuide/resources.html

David

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



cvs commit: jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation StrutsValidator.java GenericValidator.java

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:16:06

  Modified:contrib/validator/src/share/com/wintecinc/struts/validation
StrutsValidator.java GenericValidator.java
  Log:
  Added min and max length validations.
  
  Revision  ChangesPath
  1.3   +78 -0 
jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/StrutsValidator.java
  
  Index: StrutsValidator.java
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/StrutsValidator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StrutsValidator.java  2001/09/25 18:00:11 1.2
  +++ StrutsValidator.java  2001/10/17 20:16:06 1.3
  @@ -457,4 +457,82 @@
  return true;
  }
   }
  +
  +/**
  + * pChecks if the field's length is less than or equal to the maximum value.  
A codeNull/code 
  + * will be considered an error./p
  + *
  + * @parambeanThe bean validation is being performed on.
  + * @paramva  The codeValidatorAction/code that is 
currently being performed.
  + * @paramfield   The codeField/code object associated with 
the current field 
  + *   being validated.
  + * @paramerrors  The codeActionErrors/code object to add 
errors to if any 
  + *  validation errors occur.
  + * @paramrequest Current request object.
  + * @paramapplication The application's codeServletContext/code.
  +*/
  +public static boolean validateMaxLength(Object bean, 
  + ValidatorAction va, Field field, 
  + ActionErrors errors, 
  +HttpServletRequest request, 
ServletContext application) {
  +
  +   String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
  +   String sMaxLength = field.getVarValue(maxlength);
  +
  +   // NullPointerException could occur, but it will be treated as failing the 
validation
  +   try {
  +  int max = Integer.parseInt(sMaxLength);
  +  
  +  if (!GenericValidator.maxLength(value, max)) {
  + errors.add(field.getKey(), ValidatorUtil.getActionError(application, 
request, va, field));
  + 
  + return false;
  +  }
  +   } catch (Exception e) {
  +  errors.add(field.getKey(), ValidatorUtil.getActionError(application, 
request, va, field));
  +  return false;
  +   }
  +   
  +   return true;
  +}
  +
  +
  +/**
  + * pChecks if the field's length is greater than or equal to the minimum 
value.  
  + * A codeNull/code will be considered an error./p
  + *
  + * @parambeanThe bean validation is being performed on.
  + * @paramva  The codeValidatorAction/code that is 
currently being performed.
  + * @paramfield   The codeField/code object associated with 
the current field 
  + *   being validated.
  + * @paramerrors  The codeActionErrors/code object to add 
errors to if any 
  + *  validation errors occur.
  + * @paramrequest Current request object.
  + * @paramapplication The application's codeServletContext/code.
  +*/
  +public static boolean validateMinLength(Object bean, 
  + ValidatorAction va, Field field, 
  + ActionErrors errors, 
  +HttpServletRequest request, 
ServletContext application) {
  +
  +   String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
  +   String sMinLength = field.getVarValue(minlength);
  +
  +   // NullPointerException could occur, but it will be treated as failing the 
validation
  +   try {
  +  int min = Integer.parseInt(sMinLength);
  +  
  +  if (!GenericValidator.minLength(value, min)) {
  + errors.add(field.getKey(), ValidatorUtil.getActionError(application, 
request, va, field));
  + 
  + return false;
  +  }
  +   } catch (Exception e) {
  +  errors.add(field.getKey(), ValidatorUtil.getActionError(application, 
request, va, field));
  +  return false;
  +   }
  +   
  +   return true;
  +}
  +
   }
  
  
  
  1.3   +27 -0 
jakarta-struts/contrib/validator/src/share/com/wintecinc/struts/validation/GenericValidator.java
  
  Index: GenericValidator.java
  ===
  RCS file: 

cvs commit: jakarta-struts/contrib/validator/docs revision.html

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:16:56

  Modified:contrib/validator/docs revision.html
  Log:
  Added some comments for revisions not posted on home.earthlink.net/~dwinterfeldt.
  
  Revision  ChangesPath
  1.3   +11 -0 jakarta-struts/contrib/validator/docs/revision.html
  
  Index: revision.html
  ===
  RCS file: /home/cvs/jakarta-struts/contrib/validator/docs/revision.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- revision.html 2001/09/25 18:27:50 1.2
  +++ revision.html 2001/10/17 20:16:56 1.3
  @@ -50,6 +50,17 @@
  !-- Body --
  td valign=top
 H2Revision Info/H2
  +font size=-1Update/fontBR
  +ul
  +  liChanged Javascript to validate for a type of 'select-one' instead 
of 'select'.  
  +  Javascript returns 'select-one' for a field's type value.
  +  /li
  +  liAdded min and max functions./li
  +  liRemoved code from Validator retrieving the value to be validated. 
 It wasn't being used and 
  +  this way as long as you specify a unique name for a field a 
custom validator that isn't specifically 
  +  tied to a field won't generate an error in the logs.
  +  /li
  +/ul
   font size=-1Update 9/25/2001 (using Struts 9/25/2001 source)/fontBR
   ul
 liUpgraded to commons packages for Bean Utils, Collections, and the 
Digester./li
  
  
  



cvs commit: jakarta-struts/contrib/validator/src/example/com/wintecinc/struts/example/validator ApplicationResources.properties ApplicationResources_fr.properties

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:18:04

  Modified:contrib/validator/src/example/com/wintecinc/struts/example/validator
ApplicationResources.properties
ApplicationResources_fr.properties
  Log:
  Add min and max length error messages.
  
  Revision  ChangesPath
  1.2   +2 -0  
jakarta-struts/contrib/validator/src/example/com/wintecinc/struts/example/validator/ApplicationResources.properties
  
  Index: ApplicationResources.properties
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/example/com/wintecinc/struts/example/validator/ApplicationResources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApplicationResources.properties   2001/07/09 03:11:06 1.1
  +++ ApplicationResources.properties   2001/10/17 20:18:04 1.2
  @@ -9,6 +9,8 @@
   errors.ioException=I/O exception rendering error messages: {0}
   error.database.missing=liUser database is missing, cannot validate logon 
credentials/li
   errors.required={0} is required.
  +errors.minlength={0} can not be less than {1} characters.
  +errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.
   
   errors.byte={0} must be an byte.
  
  
  
  1.2   +2 -0  
jakarta-struts/contrib/validator/src/example/com/wintecinc/struts/example/validator/ApplicationResources_fr.properties
  
  Index: ApplicationResources_fr.properties
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/example/com/wintecinc/struts/example/validator/ApplicationResources_fr.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApplicationResources_fr.properties2001/07/09 03:11:07 1.1
  +++ ApplicationResources_fr.properties2001/10/17 20:18:04 1.2
  @@ -9,6 +9,8 @@
   errors.ioException=Exception de E/S rendant des messages d'erreur: {0}
   error.database.missing=liLa base de données d'utilisateur est manquante, ne peut 
pas valider des qualifications de procédure de connexion /li
   errors.required={0} est exigé.
  +errors.minlength=Le {0} ne peut pas être moins de {1} caractères.
  +errors.maxlength=Le {0} ne peut pas être les caractères {1} plus grands que. 
   errors.invalid={0} est incorrect.
   
   errors.byte=Le {0} doit être un nombre byte.
  
  
  



cvs commit: jakarta-struts/contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc ApplicationResources.properties ApplicationResources_fr.properties

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:19:27

  Modified:
contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc
ApplicationResources.properties
ApplicationResources_fr.properties
  Log:
  Added min and max length error messages.
  
  Revision  ChangesPath
  1.2   +2 -0  
jakarta-struts/contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc/ApplicationResources.properties
  
  Index: ApplicationResources.properties
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc/ApplicationResources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApplicationResources.properties   2001/07/09 03:15:14 1.1
  +++ ApplicationResources.properties   2001/10/17 20:19:27 1.2
  @@ -17,6 +17,8 @@
   errors.ioException=I/O exception rendering error messages: {0}
   error.database.missing=liUser database is missing, cannot validate logon 
credentials/li
   errors.required={0} is required.
  +errors.minlength={0} can not be less than {1} characters.
  +errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.
   
   errors.byte={0} must be an byte.
  
  
  
  1.2   +2 -0  
jakarta-struts/contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc/ApplicationResources_fr.properties
  
  Index: ApplicationResources_fr.properties
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/src/jdbc-example/com/wintecinc/struts/example/validator/jdbc/ApplicationResources_fr.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApplicationResources_fr.properties2001/07/09 03:15:14 1.1
  +++ ApplicationResources_fr.properties2001/10/17 20:19:27 1.2
  @@ -17,6 +17,8 @@
   errors.ioException=Exception de E/S rendant des messages d'erreur: {0}
   error.database.missing=liLa base de données d'utilisateur est manquante, ne peut 
pas valider des qualifications de procédure de connexion /li
   errors.required={0} est exigé.
  +errors.minlength=Le {0} ne peut pas être moins de {1} caractères.
  +errors.maxlength=Le {0} ne peut pas être les caractères {1} plus grands que. 
   errors.invalid={0} est incorrect.
   
   errors.byte=Le {0} doit être un nombre byte.
  
  
  



cvs commit: jakarta-struts/contrib/validator/web/example/WEB-INF validation.xml

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:37:05

  Modified:contrib/validator/web/example/WEB-INF validation.xml
  Log:
  Added min and max length validators and added min validation to firstName and max 
validation to lastName in the registrationForm.
  
  Revision  ChangesPath
  1.4   +88 -2 
jakarta-struts/contrib/validator/web/example/WEB-INF/validation.xml
  
  Index: validation.xml
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/example/WEB-INF/validation.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- validation.xml2001/10/16 19:29:10 1.3
  +++ validation.xml2001/10/17 20:37:05 1.4
  @@ -36,6 +36,82 @@
/javascript
 /validator
   
  +  validator name=minlength
  + classname=com.wintecinc.struts.validation.StrutsValidator
  + method=validateMinLength
  + depends=required
  + msg=errors.minlength
  + javascript![CDATA[
  +function validateMinLength(form) {  
  
  +var bValid = true;
  +var focusField = null;
  +var i = 0;  
  
  +var fields = new Array();   
  
  +oMinLength = new minlength();   
 
  +
  
  +for (x in oMinLength) { 
 
  +if (form[oMinLength[x][0]].type == 'text' || 
form[oMinLength[x][0]].type == 'textarea') {   
  +   var iMin = parseInt(oMinLength[x][2](minlength));
  +
  +   if (!(form[oMinLength[x][0]].value.length = iMin)) {
  +  if (i == 0)
  + focusField = form[oMinLength[x][0]]; 
  +
  +  fields[i++] = oMinLength[x][1];
  +
  +  bValid = false;   
  
  +   }
  
  +}   
  
  +}   
  
  +
  
  +if (fields.length  0) {
  +   focusField.focus();
  +   alert(fields.join('\n'));
  
  +}   
  
  +
  
  +return bValid;  
  
  +}]]
  + /javascript
  +  /validator
  +
  +  validator name=maxlength
  + classname=com.wintecinc.struts.validation.StrutsValidator
  + method=validateMaxLength
  + depends=required
  + msg=errors.maxlength
  + javascript![CDATA[
  +function validateMaxLength(form) {  
  
  +var bValid = true;
  +var focusField = null;
  +var i = 0;  
  
  +var fields = new Array();   
  
  +oMaxLength = new maxlength();   
 
  +  

cvs commit: jakarta-struts/contrib/validator/web/jdbc-example/WEB-INF validation.xml

2001-10-17 Thread dwinterfeldt

dwinterfeldt01/10/17 13:37:37

  Modified:contrib/validator/web/jdbc-example/WEB-INF validation.xml
  Log:
  Added min and max length validators.
  
  Revision  ChangesPath
  1.5   +76 -0 
jakarta-struts/contrib/validator/web/jdbc-example/WEB-INF/validation.xml
  
  Index: validation.xml
  ===
  RCS file: 
/home/cvs/jakarta-struts/contrib/validator/web/jdbc-example/WEB-INF/validation.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- validation.xml2001/10/16 19:31:51 1.4
  +++ validation.xml2001/10/17 20:37:37 1.5
  @@ -36,6 +36,82 @@
/javascript
 /validator
   
  +  validator name=minlength
  + classname=com.wintecinc.struts.validation.StrutsValidator
  + method=validateMinLength
  + depends=required
  + msg=errors.minlength
  + javascript![CDATA[
  +function validateMinLength(form) {  
  
  +var bValid = true;
  +var focusField = null;
  +var i = 0;  
  
  +var fields = new Array();   
  
  +oMinLength = new minlength();   
 
  +
  
  +for (x in oMinLength) { 
 
  +if (form[oMinLength[x][0]].type == 'text' || 
form[oMinLength[x][0]].type == 'textarea') {   
  +   var iMin = parseInt(oMinLength[x][2](minlength));
  +
  +   if (!(form[oMinLength[x][0]].value.length = iMin)) {
  +  if (i == 0)
  + focusField = form[oMinLength[x][0]]; 
  +
  +  fields[i++] = oMinLength[x][1];
  +
  +  bValid = false;   
  
  +   }
  
  +}   
  
  +}   
  
  +
  
  +if (fields.length  0) {
  +   focusField.focus();
  +   alert(fields.join('\n'));
  
  +}   
  
  +
  
  +return bValid;  
  
  +}]]
  + /javascript
  +  /validator
  +
  +  validator name=maxlength
  + classname=com.wintecinc.struts.validation.StrutsValidator
  + method=validateMaxLength
  + depends=required
  + msg=errors.maxlength
  + javascript![CDATA[
  +function validateMaxLength(form) {  
  
  +var bValid = true;
  +var focusField = null;
  +var i = 0;  
  
  +var fields = new Array();   
  
  +oMaxLength = new maxlength();   
 
  +

RE: Arrrg...

2001-10-17 Thread Deadman, Hal

I was getting similar errors trying to use struts post 1.0 on Weblogic 6.0
which uses jaxp 1.0. Struts 1.1 requires a server with a jaxp 1.1 xml
parser. Maybe that's the problem?

-Original Message-
From: Craig Tataryn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 4:13 PM
To: Struts Dev Group
Subject: Arrrg...


I tried resubscribing to the struts-user group to post this, but the
mail list isn't getting back to me as to whether or not it subscribed
me.  Thus I am posting this here:

I keep getting this error when starting tomcat 3.2.1 on Unix:

2001-10-17 04:03:25 - ContextManager: Adding context Ctx(/struts-example )
Exception in thread main java.lang.NoSuchMethodError
at
org.apache.commons.digester.Digester.getReader(Digester.java:527)
at
org.apache.commons.digester.Digester.parse(Digester.java:1206)
at
org.apache.struts.webapp.example.DatabaseServlet.load(DatabaseServlet.java:2
52)

at
org.apache.struts.webapp.example.DatabaseServlet.init(DatabaseServlet.java:1
75)

at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartup
Interceptor.java:130)

at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)

at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)

Any clue?

Thanks,

tataryn:craig/



Generating doc/*.xml files from javadocs

2001-10-17 Thread Matt Raible



Hello,

I am writing to find out if the docs/*.xml files in 
the source distribution of struts are "generated" or are they static. 
Ideally, I would like to use this same process to create tld's and html files 
for our tag libraries. However, I would like to generate the xml files 
(documentation) from the javadocs within my Tag Library *.java 
files.

Any ideas on this?

Thanks,

Matt


[PATCH] web cvs link incorrect on Struts homepage

2001-10-17 Thread mascolino . mr

All,
I realize this is fairly trivial, but I thought I would report it anyway.  The
Struts homepage's link to the web view of cvs is wrong.  It is still referencing
cvsweb (which doesn't appear to be there anymore).  I have attached a patch to
fix the link to point to viewcvs on cvs.apache.org.  I apologize in advance if
the patch is not what everyone expects here.  This is my first attempt at
making/submitting a patch.

mark

(See attached file: index.xml-patchfile.txt)


Mark R Mascolino
The Procter  Gamble Co.
[EMAIL PROTECTED]


index.xml-patchfile.txt
Description: Text - character set unknown


Re: Generating doc/*.xml files from javadocs

2001-10-17 Thread Craig R. McClanahan



On Wed, 17 Oct 2001, Matt Raible wrote:

 Date: Wed, 17 Oct 2001 18:07:42 -0600
 From: Matt Raible [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: Martin Gee [EMAIL PROTECTED]
 Subject: Generating doc/*.xml files from javadocs

 Hello,

 I am writing to find out if the docs/*.xml files in the source
 distribution of struts are generated or are they static.  Ideally, I
 would like to use this same process to create tld's and html files for
 our tag libraries.  However, I would like to generate the xml files
 (documentation) from the javadocs within my Tag Library *.java files.


The XML files are themselves the source files.  However, they are used to
generate two different kinds of things:

* The struts-*.xml files are used to generate BOTH the TLD files
  that you include in your application AND the Tag Library Reference
  pages in the struts-documentation webapp (HTML format).

* The remaining XML files are used to generate the rest of the
  struts-documentation stuff only (HTML format).

In the former case, this magic comes courtesy of using two different XSLT
stylesheets that take the same input, but generate different output.

You can look at the Ant build script (build.xml) for how this is done in
Struts.  The Jakarta Taglibs project http://jakarta.apache.org/taglibs
has a similar-but-different approach that accomplishes the same thing, but
again starts from XML files as the source, not the destination.

 Any ideas on this?

 Thanks,

 Matt





Re: Generating doc/*.xml files from javadocs

2001-10-17 Thread Matt Raible

Craig,

Thanks for the clarification. I figured out the part you mentioned below, and
was able to successfully use what is in struts source to generate documentation
for our own tag libraries similarly.

However, I think the javadoc information in my tag libraries and the xml source
might end up being the same.  I'm now trying to figure out if it is possible
generate the xml source from the javadocs.

Thanks,

Matt


--- Craig R. McClanahan [EMAIL PROTECTED] wrote:
 
 
 On Wed, 17 Oct 2001, Matt Raible wrote:
 
  Date: Wed, 17 Oct 2001 18:07:42 -0600
  From: Matt Raible [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Cc: Martin Gee [EMAIL PROTECTED]
  Subject: Generating doc/*.xml files from javadocs
 
  Hello,
 
  I am writing to find out if the docs/*.xml files in the source
  distribution of struts are generated or are they static.  Ideally, I
  would like to use this same process to create tld's and html files for
  our tag libraries.  However, I would like to generate the xml files
  (documentation) from the javadocs within my Tag Library *.java files.
 
 
 The XML files are themselves the source files.  However, they are used to
 generate two different kinds of things:
 
 * The struts-*.xml files are used to generate BOTH the TLD files
   that you include in your application AND the Tag Library Reference
   pages in the struts-documentation webapp (HTML format).
 
 * The remaining XML files are used to generate the rest of the
   struts-documentation stuff only (HTML format).
 
 In the former case, this magic comes courtesy of using two different XSLT
 stylesheets that take the same input, but generate different output.
 
 You can look at the Ant build script (build.xml) for how this is done in
 Struts.  The Jakarta Taglibs project http://jakarta.apache.org/taglibs
 has a similar-but-different approach that accomplishes the same thing, but
 again starts from XML files as the source, not the destination.
 
  Any ideas on this?
 
  Thanks,
 
  Matt
 
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



form action problem

2001-10-17 Thread Mike Dewhirst

We have a problem where struts is replacing form action URI's with the
Weblogic application name, but we want to be able to specify (override) the
URI ourselves. How is this possible?

e.g.

in the jsp: sh:form action=/someAction...
in generated html: form action;/appname/someAction...
we want: sh:form action=/somethingElse/someAction...

Is this possible?

I think this may be considered almost off-topic, so I'm cc'ing dev as well.


Mike








=**

If you are not the intended recipient, employee or agent responsible for delivering 
the message to the intended recipient, you are hereby notified that any dissemination 
or copying of this communication and its attachments is strictly prohibited.

If you have received this communication and its attachments in error, please return 
the original message and attachments to the sender using the reply facility on e-mail.

Internet communications are not secure and therefore the UCLES Group does not accept 
legal responsibility for the contents of this message.  Any views or opinions 
presented are solely those of the author and do not necessarily represent those of the 
UCLES Group unless otherwise specifically stated.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not guarantee that 
this email is virus free.

**=




RE: form action problem

2001-10-17 Thread Mike Dewhirst
Title: RE: form action problem





sh is just what we had to rename the html prefix to, in effect we DO have:


html:form method=post action=SomeAction


is there really nobody out there who has faced this problem?


We think the only way to resolve this is to amend the Struts source.


Mike


-Original Message-
From: Tuck Wai [mailto:[EMAIL PROTECTED]]
Sent: 17 October 2001 11:23
To: [EMAIL PROTECTED]
Subject: Re: form action problem



html:form method=post action=- you action -
- Original Message -
From: Mike Dewhirst [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, October 17, 2001 3:11 PM
Subject: form action problem



 We have a problem where struts is replacing form action URI's with the
 Weblogic application name, but we want to be able to specify (override)
the
 URI ourselves. How is this possible?

 e.g.

 in the jsp: sh:form action=/someAction...
 in generated html: form action;/appname/someAction...
 we want: sh:form action=/somethingElse/someAction...

 Is this possible?

 I think this may be considered almost off-topic, so I'm cc'ing dev as
well.


 Mike








 =**

 If you are not the intended recipient, employee or agent responsible for
delivering the message to the intended recipient, you are hereby notified
that any dissemination or copying of this communication and its attachments
is strictly prohibited.

 If you have received this communication and its attachments in error,
please return the original message and attachments to the sender using the
reply facility on e-mail.

 Internet communications are not secure and therefore the UCLES Group does
not accept legal responsibility for the contents of this message. Any views
or opinions presented are solely those of the author and do not necessarily
represent those of the UCLES Group unless otherwise specifically stated.

 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses although this does not
guarantee that this email is virus free.

 **=