Re: [VFS]: NPE in FileObject.getType().getChildren()

2004-05-20 Thread Mario Ivankovits
Paul Smith wrote:
I am getting an NPE in the following line of code, and I think it must be
thread related or something.
I have tried to reproduce it, but wasnt able to.
I collected your code into an test-class, not knowing if this is really 
what happens on your machine.

vfs itself do not use threading, and in your case, if it cant determine 
the type (=null) is is used IMAGINARY by default and thus cant be null.- 
i wonder how your NPE can happen.
But vfs itself is not thread save, if you access the same fileobject 
from two thread you should synchronize on them.

...
Now i have found a way, how this could happen too. If vfs cant determine 
the type the fileobject is already in state "attached" but the type is 
null then. However, an exception should have been thrown.
Maybe your posted exception is only the aftereffect from another 
exception before?

Could you please have a look in this direction.
Also please try this code - and eventually complete it to make them 
throw the exception.

--Mario
---cut---
/*
* Copyright 2002, 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.vfs.example;
import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileSystemManager;
import org.apache.commons.vfs.VFS;
import org.apache.commons.vfs.FileSystemException;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
public class VFSChainsaw
{
   public static void main(String[] args) throws Exception
   {
   FileSystemManager fileSystemManager = VFS.getManager();
   File[] roots = File.listRoots();
   for (int i = 0; i < roots.length; i++)
   {
   File root = roots[i];
   /* uncomment to recurse only a specific driver
   if (!root.getAbsolutePath().toLowerCase().startsWith("x:"))
   {
   continue;
   }
   */
   if (!(root.getAbsolutePath().toLowerCase().startsWith("a:") ||
   root.getAbsolutePath().toLowerCase().startsWith("b:")))
   {
   if (root.exists() && root.canRead())
   {
   FileObject fileObject = fileSystemManager
   .resolveFile(root.toURL().toExternalForm());
   System.err.println("local:" + root.getAbsolutePath() 
+ " fo:" + fileObject);

   int count = recurse(fileObject);
   System.err.println("Number Of files: "+ count);
   }
   }
   }
   }
   private static int recurse(FileObject fileObject) throws 
FileSystemException
   {
   int count = 0;

   FileObject[] fos = fileObject.getChildren();
   Collection objects = new ArrayList(Arrays.asList(fos));
   for (Iterator iter = objects.iterator(); iter.hasNext();)
   {
   count++;
   FileObject fo = (FileObject) iter.next();
   if (fo.getType().hasChildren())
   {
   // System.err.println("child:" + fo);
   iter.remove();
   count+=recurse(fo);
   }
   }
   return count;
   }
}
---cut---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [validator] Schematron-type/XPath Validator

2004-05-20 Thread Robert Leland
Don Brown wrote:
I have seen how powerful JXPath can be in projects like PMD
Just to be cautious maybe we could place the code initially in a contrib 
folder, to take a look at it ?


I wrote a simple Validator that uses JXPath to implement a 
schematron-style validation where fields are evaluated against boolean 
XPath expressions.  The idea is from the XMLForms project 
(http://www.xmlform.org), previously of Cocoon.  JXPath makes it easy 
to write complex validations on many types of objects that can span 
object trees.

The initialization of the validator looks like this:

classname="org.apache.commons.validator.JXPathValidator"
method="isValid"

methodParams="java.lang.Object,org.apache.commons.validator.Field"
msg=""/>

and a sample usage:

 
   test
   number(.) > 0 and number(.) < 10
 

The test variable contains the xpath expression to evaluate.  The 
"property" attribute contains the xpath expression to narrow the scope 
of the tested xpath.  Thanks to JXPath, this validator works on many 
different types of Java objects, including JavaBeans, and can handle 
field property xpath expressions that match multiple "nodes" or values.

If this validator would be useful for the commons-validator project, I 
can supply code for the validator, unit tests, and any patches to 
existing files, through bugzilla of course.

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


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


[VFS]: NPE in FileObject.getType().getChildren()

2004-05-20 Thread Paul Smith
Hi All,

I am getting an NPE in the following line of code, and I think it must be
thread related or something. More on that in a sec.

In this code within Chainsaw v2, the line highlighted:

FileObject[] fos = vfsNode.getFileObject().getChildren();
Collection objects = new ArrayList(Arrays.asList(fos));
for (Iterator iter = objects.iterator(); iter.hasNext();) {
FileObject fo = (FileObject) iter.next();
if(fo.getType().hasChildren()) {
iter.remove();
}
}

I get a stack trace:

java.lang.NullPointerException
at
org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractFileO
bject.java:478)
at org.apache.log4j.chainsaw.vfs.VFSPlugin$2.run(VFSPlugin.java:255)
at java.lang.Thread.run(Unknown Source)

If I debug, and place and break point on this line and step over, it all
works fine.  Only when NOT debugging.


The line in question appears to be:

public FileObject[] getChildren() throws FileSystemException
{
attach();
if (!type.hasChildren())
{
throw new
FileSystemException("vfs.provider/list-children-not-folder.error", name);
}


The particular FileObject that seems to die on me is actually a locally
mapped Windows share drive.  I am getting all the Root drives in the local
filesystem with the following code:

   File[] roots = File.listRoots();
for (int i = 0; i < roots.length; i++) {
File root = roots[i];

// Add the authors of the java.io.File class to the list of people
to "have a word" with... This is ridiculous...
if (!(root.getAbsolutePath().toLowerCase().startsWith("a:") ||
root.getAbsolutePath().toLowerCase().startsWith("b:"))) {
if(root.exists() && root.canRead()) {
FileObject fileObject = this.fileSystemManager
.resolveFile(root.toURL().toExternalForm());
DefaultMutableTreeNode node = this.fileSystemTree
.addFileObject("local:" + root.getAbsolutePath(),
fileObject);
USER_MESSAGE_LOGGER.info("Adding " +
root.getAbsolutePath());
}
}
}

[sidenote: that I can't work out how to stop Java from polling the floppy
drives and causing an error, any clues welcome]

My "H:" drive is a windows domain mapped drive.  Looks like there might be
some timing issue between the population of the type property of the
FileObject, but it only happens on these mapped drives, and ONLY when I am
not debugging through it.

Anyone seen anything like this?

cheers,

Paul Smith

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



[beanutils] Re: Indexed Array properties (that is, Indexes of Arrays)

2004-05-20 Thread robert burrell donkin
hi david
(please prefix posts about beanutils with [beanutils])
the way you tell it, it sounds like a bug. maybe i'll think of a reason 
why it was coded that way when i see the patch. craig's really busy 
right now which is a shame since the area of 'is this a feature?' is 
best dealt with by him. maybe i'll talk to the folks on struts dev if 
i'm not sure...

rather than just contributing the patch, please contribute (in 
addition) a good set of test cases which illustrate the (possible) bug.

- robert
On 20 May 2004, at 22:05, David Wood wrote:
What are people's feelings about supporting indexed properties with 
Array
value types?

What I'd like to do is allow
public String[] getIndexedArrayProperty(int index)
public void setIndexedArrayProperty(int index,String newvalue[])
Currently, this will fail with an IllegalArgumentException in
PropertyUtilsBean, because setProperty will decide to store the first
element of the newvalue array rather than the whole array. And in
BeanUtils there is a getIndexedProperty and a getArrayProperty but no
getIndexedArrayProperty. Is this for a particular reason? Or would it 
be
appropriate to add the capability?

To give a bit more background, this is actually something I've been 
doing
already with an "earlier" version of BeanUtils, and now I want to 
upgrade
to the current commons version without (immediately) giving it up.

I found myself needing to do this to store various Struts "multibox"
results (String[]) in an indexed property. This technique came from an
application written against Struts 1.0, using the old
struts.util.BeanUtils class. And this actually worked fine there - 
minus a
typo-bug in the code (in populate). I have a 1-line patch that fixes 
it,
and that's what I've been using.

Now it's time to go to Struts 1.1, and a similar "fix" to commons
BeanUtils might be useful for others, so I thought, lets see what 
everyone
thinks? Esoteric, I know, but is there anything actually wrong with
supporting indexed properties with an Array value type?

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


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


[validator] Schematron-type/XPath Validator

2004-05-20 Thread Don Brown
I wrote a simple Validator that uses JXPath to implement a 
schematron-style validation where fields are evaluated against boolean 
XPath expressions.  The idea is from the XMLForms project 
(http://www.xmlform.org), previously of Cocoon.  JXPath makes it easy to 
write complex validations on many types of objects that can span object 
trees.

The initialization of the validator looks like this:

classname="org.apache.commons.validator.JXPathValidator"
method="isValid"

methodParams="java.lang.Object,org.apache.commons.validator.Field"
msg=""/>

and a sample usage:

 
   test
   number(.) > 0 and number(.) < 10
 

The test variable contains the xpath expression to evaluate.  The 
"property" attribute contains the xpath expression to narrow the scope 
of the tested xpath.  Thanks to JXPath, this validator works on many 
different types of Java objects, including JavaBeans, and can handle 
field property xpath expressions that match multiple "nodes" or values.

If this validator would be useful for the commons-validator project, I 
can supply code for the validator, unit tests, and any patches to 
existing files, through bugzilla of course.

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


[Jakarta Commons Wiki] Updated: BeanUtilsLoggingRevisited

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:39:27
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtilsLoggingRevisited
   URL: http://wiki.apache.org/jakarta-commons/BeanUtilsLoggingRevisited

   no comment

Change Log:

--
@@ -1,3 +1,10 @@
 = Bean Utils Logging Revisited =
 
+== Removing Dependency On Commons-Logging ==
+
 SimonKiching has proposed a 
[http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=108425985928149&w=2 very 
interesting revision] to the way that BeanUtils handles logging. This proposal would 
remove the need for a dependency on commons-logging with logging only being enabled 
when the commons-logging jar is discovered in the class path.
+
+BeanUtils is widely used (as a result of inclusion in many popular downstream 
applications) so any important changes like this must be considered carefully and well 
tested.
+
+== Improved Support For Inversion Of Control Containers ==
+

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



[Jakarta Commons Wiki] New: BeanUtilsLoggingRevisited

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:37:36
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtilsLoggingRevisited
   URL: http://wiki.apache.org/jakarta-commons/BeanUtilsLoggingRevisited

   no comment

New Page:

= Bean Utils Logging Revisited =

SimonKiching has proposed a 
[http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=108425985928149&w=2 very 
interesting revision] to the way that BeanUtils handles logging. This proposal would 
remove the need for a dependency on commons-logging with logging only being enabled 
when the commons-logging jar is discovered in the class path.

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



[Jakarta Commons Wiki] Updated: BeanUtils

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:21:21
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtils
   URL: http://wiki.apache.org/jakarta-commons/BeanUtils

   no comment

Change Log:

--
@@ -5,5 +5,5 @@
 == Design ==
 
  * BeanUtils16Release
- * Post16Release
+ * BeanUtilsPost16Release
 

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



[Jakarta Commons Wiki] New: BeanUtils16Release

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:30:35
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtils16Release
   URL: http://wiki.apache.org/jakarta-commons/BeanUtils16Release

   no comment

New Page:

= BeanUtils 1.6 Release =

This is primarily a service release designed to allow downstream users to use either 
commons-collection 2.x or commons-colletions 3.x with BeanUtils. Major areas of change 
outlined below:

== Elimination of Commons Collections Dependency ==

This has been acheived by:

 1. moving some (identical) classes packages below the org.apache.commons.collections 
space into the distribution (on a temporary basis)
 1. distributing those classes which are bean related enhancements to the commons 
collections package in an optional jar

Due to demand, a third jar with everything in will also be distributed.

The appropriate methods will be deprecated allowing the collection packaged classes 
added to be removed in a future service release.

== Beanification ==

BeanUtils has been in the process of Beanification. The older Booch utilities are very 
limiting and have problems in container environments. These are being superceded by 
versions of these which are proper classes.

Work remains to be done on this. In particular, the APIs need to be reviewed and 
decisions taken about which new methods which will remain after the release and which 
need to be deprecated for the release.



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



[Jakarta Commons Wiki] New: BeanUtilsPost16Release

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:32:50
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtilsPost16Release
   URL: http://wiki.apache.org/jakarta-commons/BeanUtilsPost16Release

   no comment

New Page:

= BeanUtils Post 1.6 Release =

The BeanUtils16Release is needed in haste. Therefore, some changes which would 
otherwise be considered straight away now need to be put on hold. Hopefully the design 
ideas can be developed here on the wiki.

 * BeanUtilsLoggingRevisited

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



[Jakarta Commons Wiki] New: BeanUtils

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:21:08
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BeanUtils
   URL: http://wiki.apache.org/jakarta-commons/BeanUtils

   no comment

New Page:

= Commons BeanUtils Component =

Commons-BeanUtils provides easy-to-use wrappers around the Java reflection and 
introspection APIs.

== Design ==

 * BeanUtils16Release
 * Post16Release


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



[Jakarta Commons Wiki] Updated: FrontPage

2004-05-20 Thread commons-dev
   Date: 2004-05-20T14:18:22
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: FrontPage
   URL: http://wiki.apache.org/jakarta-commons/FrontPage

   no comment

Change Log:

--
@@ -14,6 +14,7 @@
 = Components =
 
 On this wiki:
+ * [:BeanUtils] - [http://jakarta.apache.org/commons/beanutils] is a collection of 
bean related libraries.
  * [:Betwixt] - Betwixt provides services for mapping JavaBeans to XML documents, and 
vice versa.
  * [:Codec] -  Codec contains some general encoding/decoding algorithms. Includes 
some phonetic encoders, Hex, Base64, and a URL encoder.
  * [:Collections] -  Collections builds upon the Java Collections Framework of List, 
Set and Map to provide many more implementations, new collections and abstract base 
classes.

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



Re: [logging][PROPOSAL] a solution to incompatibility between log4j versions

2004-05-20 Thread robert burrell donkin
On 19 May 2004, at 23:11, Adam R. B. Jack wrote:

i haven't found time to fix digester, beanutils and struts gump runs
yet but i hope to do so tomorrow. i you could give me some quick
pointers to the best way to do the additional targets, i'll add them 
to
my list of stuff to do...
Thanks for doing that.
don't thank me too early...
i've spend all tonight porting content from the old to the new wiki. 
fridays is pub-straight-from-work night for me, so most likely it'll be 
the weekend before i get a chance to look at this.

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


Re: [logging][PROPOSAL] a solution to incompatibility between log4j versions

2004-05-20 Thread robert burrell donkin
On 20 May 2004, at 13:49, Shapira, Yoav wrote:
Anyways, I wanted to point out a small item: the additional
functionality and other changes from log4j 1.2 to 1.3 would easily be
considered by many projects a 2.0 or major release.
but (in log4j's defense), this is consistent with previous log4j 
practice.

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


Re: [Jakarta Commons Wiki] New: CreatingStandardWebPresence

2004-05-20 Thread robert burrell donkin
On 20 May 2004, at 21:43, Vincent Massol wrote:

=== Commons Proper Components ===
* BeanUtils - Has Maven site, but  not default.
* Betwixt - Maven site.
* Cactus - Promoted, but still in Proper CVS.
FWIW, I believe I have removed the Cactus CVS content from jakarta
commons at the time of the move (a few years ago). What's left should
only be an empty directory... :-)
aren't wiki's brilliant! write once, forget forever ;)
what's left are lots of empty directories (so i guess the wiki was 
right after all - all hail the wiki :)

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


Indexed Array properties (that is, Indexes of Arrays)

2004-05-20 Thread David Wood
What are people's feelings about supporting indexed properties with Array 
value types?

What I'd like to do is allow 

public String[] getIndexedArrayProperty(int index)
public void setIndexedArrayProperty(int index,String newvalue[])

Currently, this will fail with an IllegalArgumentException in 
PropertyUtilsBean, because setProperty will decide to store the first 
element of the newvalue array rather than the whole array. And in 
BeanUtils there is a getIndexedProperty and a getArrayProperty but no 
getIndexedArrayProperty. Is this for a particular reason? Or would it be 
appropriate to add the capability?

To give a bit more background, this is actually something I've been doing 
already with an "earlier" version of BeanUtils, and now I want to upgrade 
to the current commons version without (immediately) giving it up.

I found myself needing to do this to store various Struts "multibox" 
results (String[]) in an indexed property. This technique came from an 
application written against Struts 1.0, using the old 
struts.util.BeanUtils class. And this actually worked fine there - minus a 
typo-bug in the code (in populate). I have a 1-line patch that fixes it, 
and that's what I've been using. 

Now it's time to go to Struts 1.1, and a similar "fix" to commons 
BeanUtils might be useful for others, so I thought, lets see what everyone 
thinks? Esoteric, I know, but is there anything actually wrong with 
supporting indexed properties with an Array value type? 

Regards,
David

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



[Jakarta Commons Wiki] Updated: FrontPage

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:52:00
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: FrontPage
   URL: http://wiki.apache.org/jakarta-commons/FrontPage

   no comment

Change Log:

--
@@ -35,25 +35,19 @@
 
 TheSandbox is an open workspace for jakarta committers. This is also divided into 
components.
 
-== Components ==
-
-On this wiki:
+
 
- * ResourcesProjectPages
+== Third Party Resources  ==
 
-
+ * [http://www.java201.com/resources/browse/70-all.html Jakarta Commons Resources]
 
-== Other Documentation ==
+== Developer Documentation ==
 
  * MovingFromSandboxToProper
 
  * CreatingStandardWebPresence
 
- * GettingInvloved - General Documentation for all Apache Commiters and 
ReleaseManager concerning various subjects (like SigningReleases, MavenRepository, and 
[[Mirroring]]) 
-
-== Third Party Resources  ==
-
- * [http://www.java201.com/resources/browse/70-all.html Jakarta Commons Resources]
+ * GettingInvloved - General Documentation for all Apache Commiters and 
ReleaseManager concerning various subjects (like SigningReleases, MavenRepository, and 
[:Mirroring]) 
 
 
 {{{

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



[Jakarta Commons Wiki] Updated: Betwixt

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:49:33
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Betwixt
   URL: http://wiki.apache.org/jakarta-commons/Betwixt

   no comment

Change Log:

--
@@ -8,11 +8,6 @@
 It's only in alpha but already people are demanding that the design be improved. This 
refactoring should make the design easier to understand - and so make it easier for 
people to contribute. (And yes, it'll hopefully make the life of the existing 
committers that much easier as well ;)
 
  * BetwixtDesignNextGeneration
- * BetwixtUseCases
 

 
-== Related ==
- 
- * XmlMappingFrameworkComparison
 

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



[Jakarta Commons Wiki] Updated: BetwixtDesignNextGeneration

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:48:16
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BetwixtDesignNextGeneration
   URL: http://wiki.apache.org/jakarta-commons/BetwixtDesignNextGeneration

   no comment

Change Log:

--
@@ -1,5 +1,4 @@
-
-Up to BetwixtComponentPage
+Up to [:Betwixt]
 
 
 
@@ -9,4 +8,4 @@
 
 
 
-Up to BetwixtComponentPage
+Up to [:Betwixt]

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



[Jakarta Commons Wiki] New: BetwixtDesignNextGeneration

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:47:51
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: BetwixtDesignNextGeneration
   URL: http://wiki.apache.org/jakarta-commons/BetwixtDesignNextGeneration

   Moved from original content

New Page:


Up to BetwixtComponentPage



= Betwixt Design - The Next Generation =

A space for design ideas.



Up to BetwixtComponentPage

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



[Jakarta Commons Wiki] Updated: Betwixt

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:46:42
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Betwixt
   URL: http://wiki.apache.org/jakarta-commons/Betwixt

   no comment

Change Log:

--
@@ -1,4 +1,4 @@
- =Betwixt Component Page = 
+= Betwixt Component Page = 
 
 Betwixt is an xml-object mapping component devised (originally) by 
[http://radio.weblogs.com/0112098/ James Strachan]. It 
[http://jakarta.apache.org/commons/betwixt/index.html lives] in 
[http://jakarta.apache.org/commons/ Jakarta-Commons].
 
@@ -11,6 +11,8 @@
  * BetwixtUseCases
 
 ---
+
+== Related ==
  
  * XmlMappingFrameworkComparison
 

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



[Jakarta Commons Wiki] Updated: Betwixt

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:46:13
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Betwixt
   URL: http://wiki.apache.org/jakarta-commons/Betwixt

   no comment

Change Log:

--
@@ -1,12 +1,9 @@
-
-
-= Betwixt Component Page = 
+ =Betwixt Component Page = 
 
 Betwixt is an xml-object mapping component devised (originally) by 
[http://radio.weblogs.com/0112098/ James Strachan]. It 
[http://jakarta.apache.org/commons/betwixt/index.html lives] in 
[http://jakarta.apache.org/commons/ Jakarta-Commons].
 
-
 
-== Contribute To The Betwixt Design!==
+== Contribute To The Betwixt Design! ==
 
 It's only in alpha but already people are demanding that the design be improved. This 
refactoring should make the design easier to understand - and so make it easier for 
people to contribute. (And yes, it'll hopefully make the life of the existing 
committers that much easier as well ;)
 

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



[Jakarta Commons Wiki] New: Betwixt

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:45:51
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Betwixt
   URL: http://wiki.apache.org/jakarta-commons/Betwixt

   Moved content from original wiki

New Page:



= Betwixt Component Page = 

Betwixt is an xml-object mapping component devised (originally) by 
[http://radio.weblogs.com/0112098/ James Strachan]. It 
[http://jakarta.apache.org/commons/betwixt/index.html lives] in 
[http://jakarta.apache.org/commons/ Jakarta-Commons].



== Contribute To The Betwixt Design!==

It's only in alpha but already people are demanding that the design be improved. This 
refactoring should make the design easier to understand - and so make it easier for 
people to contribute. (And yes, it'll hopefully make the life of the existing 
committers that much easier as well ;)

 * BetwixtDesignNextGeneration
 * BetwixtUseCases

---
 
 * XmlMappingFrameworkComparison


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



RE: [Jakarta Commons Wiki] New: CreatingStandardWebPresence

2004-05-20 Thread Vincent Massol


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:commons-
> [EMAIL PROTECTED]
> Sent: 20 May 2004 21:25
> To: [EMAIL PROTECTED]
> Subject: [Jakarta Commons Wiki] New: CreatingStandardWebPresence

[snip]

> 
> === Commons Proper Components ===
> 
> * BeanUtils - Has Maven site, but  not default.
> * Betwixt - Maven site.
> * Cactus - Promoted, but still in Proper CVS.

FWIW, I believe I have removed the Cactus CVS content from jakarta
commons at the time of the move (a few years ago). What's left should
only be an empty directory... :-) 

[snip]

Thanks
-Vincent



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



[Jakarta Commons Wiki] New: MovingFromSandboxToProper

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:42:11
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: MovingFromSandboxToProper
   URL: http://wiki.apache.org/jakarta-commons/MovingFromSandboxToProper

   Moved from original wiki

New Page:

This page describes how to move a component from the commons sandbox to the commons 
proper.  This page assumes you're already an Apache committer with karma for both 
jakarta-commons and jakarta-commons-sandbox.  If you don't have karma, ask for it or 
get someone to help you.

 1. Start vote on commons-dev mailing list, stating reason for promotion of the 
component.

 1. After vote passes, send announcement with time of move and remind everyone to have 
any files in the component checked in by that time.

 1. Actual CVS move:

  i. Log in to your Apache cvs account
  i. Checkout jakarta-commons and jakarta-commons-sandbox, and:
{{{
$cd jakarta-commons-sandbox/foo

$cvs import jakarta-commons/foo commons_sandbox commons_promotion
}}}
[the latter two arguments are required by CVS but arbitrary -- read help on cvs import 
for more details]  Also, it will ask you for a commit message.  I couldn't remember 
the vi commands to save (:w) or quit (:q): http://www.vmunix.com/~gabor/vi.html#Partb
{{{
$cd ..

$cvs remove -fR foo

$cd ..

$cvs commit
}}}

That's it for the actual CVS move.  Verify the move succeeded by doing a clean 
checkout of both jakarta-commons and jakarta-commons-sandbox.  Verify that ViewCVS has 
picked up the changes correctly.

 1. Make sure your component still builds OK by building it in its new home.

 1. Update the web site for your component.  Start with maven clean if your site is 
mavenized.  Your site should now be at jakarta.apache.org/commons/foo rather than 
jakarta.apache.org/commons/sandbox/foo

 1. Update the commons web site to reflect your component's move.  You will need to 
update the menus under jakarta-commons/xdocs/stylesheet/menus (components.xml and 
sandbox.xml), as well as the main jakarta-commons/xdocs/components.xml file.

 1. Send an announcement to commons-dev and commons-user announcing the move.

 1. Gather a list of committers for the component, ask [EMAIL PROTECTED] to give them 
commit access to component in commons-proper.

 1. Start planning a release ;)

(Appendix)

 1. Check-out jakarta-site2 and edit jakarta-site2/xdocs/index.xml and news.xml. Put a 
news of "Commons-XX graduated from Sandbox to Commons-Proper"

 


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



[Jakarta Commons Wiki] Updated: FrontPage

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:40:25
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: FrontPage
   URL: http://wiki.apache.org/jakarta-commons/FrontPage

   no comment

Change Log:

--
@@ -49,8 +49,6 @@
 
  * CreatingStandardWebPresence
 
- * JakartaCommonsDataBeans
-
  * GettingInvloved - General Documentation for all Apache Commiters and 
ReleaseManager concerning various subjects (like SigningReleases, MavenRepository, and 
[[Mirroring]]) 
 
 == Third Party Resources  ==

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



[Jakarta Commons Wiki] Updated: ValidatorWishList

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:37:40
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorWishList
   URL: http://wiki.apache.org/jakarta-commons/ValidatorWishList

   no comment

Change Log:

--
@@ -5,21 +5,21 @@
 
 A space for wishes validator future functionality.
 
- * '''distributable config files''' - It would be nice if the 
validation.xml could be split up so that the validation.xml could be stored in jars 
and brought together in a central validation.xml config
+ * '''distributable config files''' - It would be nice if the validation.xml could be 
split up so that the validation.xml could be stored in jars and brought together in a 
central validation.xml config
 
- * '''Extendable validation configs''' - It would also be cool if 
validation configs were extendable. Sometimes several beans have some commons 
requirements. This would be similar to TilesExtendableDefinitions.
+ * '''Extendable validation configs''' - It would also be cool if validation configs 
were extendable. Sometimes several beans have some commons requirements. This would be 
similar to TilesExtendableDefinitions.
 
- * '''Continuous error-checking with indexed properties'''  - The validator 
stops checking for errors when it finds an error with indexed properties. It would be 
nice if the validator continued checking and caught ''all'' errors of the indexed 
property. Maybe even better: make this an optional feature!
+ * '''Continuous error-checking with indexed properties''' - The validator stops 
checking for errors when it finds an error with indexed properties. It would be nice 
if the validator continued checking and caught ''all'' errors of the indexed property. 
Maybe even better: make this an optional feature!
 
- * '''Multiple-Fields-Validation''' - It would be more than cool to apply 
validation rules
+ * '''Multiple-Fields-Validation'''- It would be more than cool to apply validation 
rules
 to more than one field (if  and/or 
)
 
- * '''Documented-Examples''' - To become more useful, some documented 
application examples
+ * '''Documented-Examples''' - To become more useful, some documented application 
examples
 apart from those printed in books could be supplied.
 
- * '''RegExp field names''' If the property attribute of the  element allowed 
for regular expressions or even simply supported an asterisk for wild card matching.
+ * '''RegExp field names''' - If the property attribute of the  element 
allowed for regular expressions or even simply supported an asterisk for wild card 
matching.
 
- * '''Handling of float, double and bigDecimal'''should honor the locale of the user. 
Converting from a string to a double using new Double(s) will breake 
outside of USA.
+ * '''Handling of float, double and bigDecimal''' should honor the locale of the 
user. Converting from a string to a double using new Double(s) will 
breake outside of USA.
 
 
 

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



[Jakarta Commons Wiki] New: ValidatorWishList

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:36:21
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorWishList
   URL: http://wiki.apache.org/jakarta-commons/ValidatorWishList

   Moved content from original wiki

New Page:

Up to [:Validator]


= Validator Wish List =

A space for wishes validator future functionality.

 * '''distributable config files''' - It would be nice if the validation.xml 
could be split up so that the validation.xml could be stored in jars and brought 
together in a central validation.xml config

 * '''Extendable validation configs''' - It would also be cool if validation 
configs were extendable. Sometimes several beans have some commons requirements. This 
would be similar to TilesExtendableDefinitions.

 * '''Continuous error-checking with indexed properties'''  - The validator 
stops checking for errors when it finds an error with indexed properties. It would be 
nice if the validator continued checking and caught ''all'' errors of the indexed 
property. Maybe even better: make this an optional feature!

 * '''Multiple-Fields-Validation''' - It would be more than cool to apply 
validation rules
to more than one field (if  and/or 
)

 * '''Documented-Examples''' - To become more useful, some documented 
application examples
apart from those printed in books could be supplied.

 * '''RegExp field names''' If the property attribute of the  element allowed 
for regular expressions or even simply supported an asterisk for wild card matching.

 * '''Handling of float, double and bigDecimal'''should honor the locale of the user. 
Converting from a string to a double using new Double(s) will breake 
outside of USA.



Up to [:Validator]


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



[Jakarta Commons Wiki] New: ValidatorNumberWithSeperators

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:32:25
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorNumberWithSeperators
   URL: http://wiki.apache.org/jakarta-commons/ValidatorNumberWithSeperators

   Moved content from original wiki

New Page:

Up to ValidatorExtensions

= Question =
{{{
 Does anyone have any recommendations for validating
 user-entered numbers with separators? (For example,
 the string "10,000.00".) Validator uses the Double
 constructor in its GenericTypeValidator.formatDouble
 method.
}}}

= Answer =

I wound up creating my own custom FieldChecks class
with a validateDouble method that delegates to a new
formatDouble method. Here's the code for formatDouble:
{{{
public static Double formatDouble(String s) throws
 NumberFormatException {
DecimalFormatSymbols syms = new DecimalFormatSymbols();
StringBuffer buff = new StringBuffer();
StringCharacterIterator iter = new StringCharacterIterator(s);
for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
if(c != syms.getGroupingSeparator()) {
buff.append(c);
}
}

return GenericTypeValidator.formatDouble(buff.toString());
}
}}}

Let me know if anyone has a better solution.

Matt Howitt

Up to ValidatorExtensions


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



[Jakarta Commons Wiki] New: ValidatorExtensions

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:31:18
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorExtensions
   URL: http://wiki.apache.org/jakarta-commons/ValidatorExtensions

   Moved content from original wiki

New Page:

Up to [:Validator]


= Validator Extensions =

A space for validator extensions.

 * ValidatorNumberWithSeperators



Up to [:Validator]


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



[Jakarta Commons Wiki] Updated: ValidatorExamples

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:29:59
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorExamples
   URL: http://wiki.apache.org/jakarta-commons/ValidatorExamples

   no comment

Change Log:

--
@@ -1,7 +1,7 @@
 Up to [:Validator].
 
 
-Validator Examples
+= Validator Examples =
 
 A space for validator examples.
 

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



[Jakarta Commons Wiki] New: ValidatorExamples

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:29:45
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorExamples
   URL: http://wiki.apache.org/jakarta-commons/ValidatorExamples

   Moved content from original wiki

New Page:

Up to [:Validator].


Validator Examples

A space for validator examples.

 * Please add one here :)
 


Up to [:Validator]

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



[Jakarta Commons Wiki] New: ValidatorResources

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:26:44
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorResources
   URL: http://wiki.apache.org/jakarta-commons/ValidatorResources

   Moved content from original wiki

New Page:

Up to [:Validator]


To anyone who might need it, I gave a presentation on the Validator at the Struts 
Atlanta group last 
week.http://sourceforge.net/project/showfiles.php?group_id=49385&release_id=159118

It's also available from the Struts Atlanta Site.

Let me know if you want the powerpoint to swipe any of the slides out of it. Email me 
at chuckcavaness at yahoo.com


Up to [:Validator]


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



[Jakarta Commons Wiki] New: ValidatorStandalone

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:24:24
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorStandalone
   URL: http://wiki.apache.org/jakarta-commons/ValidatorStandalone

   Moved from original wiki

New Page:

Up to ValidatorFaq

= I would like to use validator stand alone - How Do I Do It? =

== Answer(s) ==

The O'Reilly book 'Jakarta Struts' by Chuck Cavaness has a small section
on the subject starting on page 279 that might be of help. I've never tried
it though...

-Jeff Kyser



Up to ValidatorFaq


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



[Jakarta Commons Wiki] New: ValidatorRequiredIf

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:22:54
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorRequiredIf
   URL: http://wiki.apache.org/jakarta-commons/ValidatorRequiredIf

   Moved from original wiki

New Page:

Up to ValidatorFaq

= Please anybody can provide usage of 'requiredif' validation? =

== Answer(s) ==

http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt

--Dan Tran


Up to ValidatorFaq


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



[Jakarta Commons Wiki] Updated: ValidatorRequiredRequiredIf

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:21:37
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorRequiredRequiredIf
   URL: http://wiki.apache.org/jakarta-commons/ValidatorRequiredRequiredIf

   no comment

Change Log:

--
@@ -3,9 +3,13 @@
 
 My question is:
 if a field is a condition required date field, then i must write like 
+{{{

+}}}
 Or can I write like this?
+{{{

+}}}
 
 
 

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



[Jakarta Commons Wiki] New: ValidatorRequiredRequiredIf

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:21:04
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorRequiredRequiredIf
   URL: http://wiki.apache.org/jakarta-commons/ValidatorRequiredRequiredIf

   Moved content from original wiki

New Page:

Up to ValidatorFaq


My question is:
if a field is a condition required date field, then i must write like 
   
Or can I write like this?
   



That's how it works by design.  required or requiredif need to come before optional 
validations. 
Validations like date won't fire unless there's some actual data.



Up to ValidatorFaq


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



[Jakarta Commons Wiki] New: ValidatorRegExpI18

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:19:02
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorRegExpI18
   URL: http://wiki.apache.org/jakarta-commons/ValidatorRegExpI18

   Moved from original wiki

New Page:



= Validator Regular Expression I18 FAQ =

== Is it possible to use special characters (like german "Umlaute") in an regular 
expression.. ==
I tried this:
{{{

  name
  ^[\-\'\`\´\.\ 
a-zäöüßáéíúóàèìùòâêîôûñA-ZÄÖÜÁÉÍÓÚÀÈÌÒÙÑ]+$

}}}

== Answer ==
Samuel Opoku-Boadu answers:
{{{
  
 
alphanumeric
^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-]*$
 
 
   alphanumericSP
   ^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-\ ]*$
 
  
}}}

Up to ValidatorRegularExpressions

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



[Jakarta Commons Wiki] New: ValidatorRegularExpressions

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:17:52
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorRegularExpressions
   URL: http://wiki.apache.org/jakarta-commons/ValidatorRegularExpressions

   Moved content from original wiki

New Page:

Up to ValidatorFaq

= Validator Regular Expression FAQ =

A space for validator Frequently asked questions.

 * ValidatorRegExpI18 - How do I use International Characters in a RegExp


Up to ValidatorFaq

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



DO NOT REPLY [Bug 29129] New: - FileUtils missing path-related methods

2004-05-20 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29129

FileUtils missing path-related methods

   Summary: FileUtils missing path-related methods
   Product: Commons
   Version: 1.0 Final
  Platform: All
   URL: http://jakarta.apache.org/commons/io/apidocs/org/apache/
commons/io/FileUtils.html
OS/Version: Other
Status: NEW
  Severity: Major
  Priority: Other
 Component: IO
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


The path-related methods described in its javadoc, such as removePath(), are 
all missing from the code.

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



[Jakarta Commons Wiki] New: ValidatorNoClassDefFound

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:16:06
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorNoClassDefFound
   URL: http://wiki.apache.org/jakarta-commons/ValidatorNoClassDefFound

   Moved content from original wiki

New Page:

Up to ValidatorFaq


4. November 2002

I am getting a really strange behaviour when using the struts validator.
Infact I am beginning to wonder whether it´s just me going nuts!  It´s
an error that makes no sense to me at all!

Here´s the scenario:

 1. Start tomcat
 1. open browser
 1. go to form in html page
 1. send

Now the strange thing is that every second time (after closing the 2 of
course) I carry out the steps described above I get a 
{{{
 java.lang.NoClassDefFoundError: org.apache.struts.validator.ValidatorForm
}}}

error!  Why not every time or even never?!  It just doesn´t make sense
t o me that this error comes in exactly the interval as described above.
Has anybody else experienced a similar problem which might be worth
sharing?

I know it sounds silly but that is exactly what is happening!

== Answer ==

It seems that this is a session issue and the solution was to 
change the context in the tomcat server.xml:

I.e. I added:
{{{

   

}}}
to my Context.

Michael Delamere




Up to ValidatorFaq


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



[Jakarta Commons Wiki] Updated: ValidatorMinimumSteps

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:13:48
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorMinimumSteps
   URL: http://wiki.apache.org/jakarta-commons/ValidatorMinimumSteps

   no comment

Change Log:

--
@@ -21,8 +21,7 @@
  1. Add to the page:
   a. In the head section: 
   a. for the form tag: onsubmit="return validate(this)"
- 1. Create application resource file with required keys (if does not exist
-yet)
+ 1. Create application resource file with required keys (if does not exist yet)
  1. Add reference to resource file into the struts-config.xml
 
 P.S. it is possible to avoid step #4 and #5 if definitions in validation.xml

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



[Jakarta Commons Wiki] New: ValidatorMinimumSteps

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:13:29
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorMinimumSteps
   URL: http://wiki.apache.org/jakarta-commons/ValidatorMinimumSteps

   Moved content from original wiki

New Page:

Up to ValidatorFaq

{{{ 
 I want to use Validator for client-side
 validation. I put definations in validation.xml, put
 onsubmit="return validateRegistryForm(this);" in my jsp file and do not
 touch validator-rules.xml.  When I press submit button, the javascript
 validation does not work.

 Any wrong with that?

 Leon
}}}

== Answer(s) ==

Minimum steps to have built-in validation working:

 1. Add validation plug-in into the struts-config.xml
 1. Put definitions in validation.xml
 1. Add to the page:
  a. In the head section: 
  a. for the form tag: onsubmit="return validate(this)"
 1. Create application resource file with required keys (if does not exist
yet)
 1. Add reference to resource file into the struts-config.xml

P.S. it is possible to avoid step #4 and #5 if definitions in validation.xml
do not require resources.

Regards,
Sergey Smirnov


Up to ValidatorFaq


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



[Jakarta Commons Wiki] Updated: ValidatorJavaScriptTld

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:11:25
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorJavaScriptTld
   URL: http://wiki.apache.org/jakarta-commons/ValidatorJavaScriptTld

   no comment

Change Log:

--
@@ -1,5 +1,6 @@
 Up to ValidatorFaq

+
+
 == Question ==
 {{{
  I'm little bit confused about using validator framework.
@@ -7,6 +8,7 @@
  In struts 1.1 beta 3 release, do I need to keep struts-validator.tld
  file under WEB-INF folder ?
 }}}
+
 == Answer ==
 There is no struts-validator.tld. The definition for  is found in the
 struts-html.tld. I you are using a Servlet 2.3/JSP 1.2 Container you don't need the

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



[Jakarta Commons Wiki] New: ValidatorJavaScriptTld

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:11:00
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorJavaScriptTld
   URL: http://wiki.apache.org/jakarta-commons/ValidatorJavaScriptTld

   Moved from original wiki

New Page:

Up to ValidatorFaq
---
== Question ==
{{{
 I'm little bit confused about using validator framework.

 In struts 1.1 beta 3 release, do I need to keep struts-validator.tld
 file under WEB-INF folder ?
}}}
== Answer ==
There is no struts-validator.tld. The definition for  is found in the
struts-html.tld. I you are using a Servlet 2.3/JSP 1.2 Container you don't need the
tld's because the container can find them in the struts.jar. For 2.2/1.1 the web.xml 
says where to find
the tld files.

Also, PLEASE, upgrade to Struts 1.1 Final, or the latest release.
A number of bugs were fixed with validation, which save you much time and agony !!!


Up to ValidatorFaq

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



[Jakarta Commons Wiki] New: ValidatorDispatchAction

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:08:31
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorDispatchAction
   URL: http://wiki.apache.org/jakarta-commons/ValidatorDispatchAction

   Moved from original wiki

New Page:

up to ValidatorFaq

= How to use validator with dispatchAction =

== Answer(s) ==
if you want to use different validation rules with the validator you have to declare 
different action elements in your struts-config.xml file (using the same action class 
if you want). for that you have to use the (Dyna)ValidatorActionForm.

another means is to validate your form in the methods of your DispatchAction class as 
in this example:

struts-config.xml:
{{{

 

}}}
LogonAction.java:
{{{
   ActionErrors errors = new ActionErrors();
   errors = form.validate(mapping, request);

   // Report any errors we have discovered back to the original form
   if (!errors.isEmpty())
   {
   saveErrors(request, errors);
   return  new ActionForward(mapping.getInput());
   }
}}}

<[EMAIL PROTECTED]>
Or you could also write a thin wrapper around the validationframework to validate a 
single field at the time. For instance the following code carries out the validation 
of the form field at the same time it retrieves its value:

{{{
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;

 import javax.servlet.http.*;

 import org.apache.struts.action.*;
 import org.apache.struts.validator.DynaValidatorForm;

 public class CustomValidator {
ActionErrors formValidationErrors;
DynaValidatorForm form;
private static final Logger logger = Logger.getLogger(MosaicValidator.class);

/**
 * Creates a new MosaicValidator object.
 * 
 * @param form parameter
 * @param mapping parameter
 * @param request parameter
 */
public MosaicValidator(DynaValidatorForm form, ActionMapping mapping, 
HttpServletRequest request) {
this.form = form;
formValidationErrors = form.validate(mapping, request);
 }

/**
 * Get the value for a particular form field, and validate the value the user 
has enteed against the Struts validation file
 * 
 * @param key parameter
 * @param errors parameter
 * @return returnValue 
 */
public final Object validate(String key, ActionErrors errors) {
Iterator it = formValidationErrors.get(key);
while (it.hasNext()) {
ActionError e = (ActionError)it.next();
errors.add(key, e);
 }
 return form.get(key);
 }
 }
}}}



This can be called in the following manner from an action extending DispatchAction:
{{{
  public ActionForward viewForm (ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response)
   throws Exception {
ActionErrors errors = new ActionErrors();
MosaicValidator v=new MosaicValidator( (DynaValidatorForm)form, 
mapping, request);
String formField = (String)v.validate("formField", errors);
if (!errors.isEmpty()) {
saveErrors(request, errors);
return (mapping.getInputForm() );
}
return viewForm(mapping, form, request, response);
 }
}}}
Hope this helps someone.





up to ValidatorFaq


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



[Jakarta Commons Wiki] Updated: ValidatorSetup

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:04:42
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorSetup
   URL: http://wiki.apache.org/jakarta-commons/ValidatorSetup

   no comment

Change Log:

--
@@ -8,7 +8,7 @@
 
  * edit your struts-config.xml:
 
- ** put the validator plug-in xml into the plug-ins section:
+   * put the validator plug-in xml into the plug-ins section:
 {{{
 
 
@@ -17,13 +17,13 @@
 value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
 
 }}}
- ** create the form configuration in struts-config.xml for the form-names, e.g. for 
ValidatorForms:
+   * create the form configuration in struts-config.xml for the form-names, e.g. for 
ValidatorForms:
 {{{
 
 
 }}}
- ** or for DynaValidatorForms (we have to specify the fields we want here - and it's 
best to stick to Strings rather than trying to deal with Integers or Dates etc which 
do not get populated if the user enters the wrong type of data):
+   * or for DynaValidatorForms (we have to specify the fields we want here - and it's 
best to stick to Strings rather than trying to deal with Integers or Dates etc which 
do not get populated if the user enters the wrong type of data):
 {{{
 
@@ -34,7 +34,7 @@
 
 }}}
 
- ** configure the action mapping e.g.:
+   * configure the action mapping e.g.:
 {{{
 
 
 }}}
- *** set validate=true 
- *** set input=/my/path  so that struts can send the request somewhere on 
validation-failure - this can be another action path like the example above, or a 
tiles definition (normally beginning with '.'), or any other page in your app.
- *** add form-name as 'name' attribute
- *** set the scope to request, or if you want to make use of 'work-flow' or 'wizard' 
techniques or other patterns that allow you to accumulate data over several HTTP 
requests, put 'session' instead.
+ * set validate=true 
+ * set input=/my/path  so that struts can send the request somewhere on 
validation-failure - this can be another action path like the example above, or a 
tiles definition (normally beginning with '.'), or any other page in your app.
+ * add form-name as 'name' attribute
+ * set the scope to request, or if you want to make use of 'work-flow' or 
'wizard' techniques or other patterns that allow you to accumulate data over several 
HTTP requests, put 'session' instead.
 
  * create validation.xml config file in WEB-INF - using the same form names as in 
struts-config.xml e.g.:
 {{{
@@ -93,13 +93,13 @@
 focus="optionText">
 }}}   
  * to enable client-side validation:
- ** make sure you include the onsubmit attribute with the html:form tag 
+   * make sure you include the onsubmit attribute with the html:form tag 
 {{{
   
 focus="optionText"
 onsubmit="return validateForm(this);">
 }}}   
- ** include in the JSP the html:javascript tag with the same form-name as above and 
dynamic=true
+   * include in the JSP the html:javascript tag with the same form-name as above and 
dynamic=true
 {{{
   
 }}}
- ** the 'method' should be the same as what you specified for the html:form onsubmit 
attribute.
+   * the 'method' should be the same as what you specified for the html:form onsubmit 
attribute.
 
  * you could set static=true there as well, but it is more efficient to create an 
extra page with just that taglib in it, set to produce only static javascript (needs 
no form-name then) - and refer to it from your JSP using 

[Jakarta Commons Wiki] Updated: ValidatorSetup

2004-05-20 Thread commons-dev
   Date: 2004-05-20T13:01:19
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorSetup
   URL: http://wiki.apache.org/jakarta-commons/ValidatorSetup

   no comment

Change Log:

--
@@ -1,14 +1,14 @@
 This is a basic 1,2,3 guide that anyone can expand upon when they have something 
useful to add:\
 
-* get commons-validator.jar - go to [http://jakarta.apache.org/ jakarta] to download 
the latest version.
+ * get commons-validator.jar - go to [http://jakarta.apache.org/ jakarta] to download 
the latest version.
 
-* put it in your classpath - this is normally WEB-INF/lib/ along with the other jars 
such as struts.jar
+ * put it in your classpath - this is normally WEB-INF/lib/ along with the other jars 
such as struts.jar
 
-* create action forms to be validated - based on ValidatorForm, or just use 
DynaActionForms and don't worry about coding classes for them - all that's needed is 
the form config in struts-config.xml (see below)
+ * create action forms to be validated - based on ValidatorForm, or just use 
DynaActionForms and don't worry about coding classes for them - all that's needed is 
the form config in struts-config.xml (see below)
 
-* edit your struts-config.xml:
+ * edit your struts-config.xml:
 
-** put the validator plug-in xml into the plug-ins section:
+ ** put the validator plug-in xml into the plug-ins section:
 {{{
 
 
@@ -17,13 +17,13 @@
 value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
 
 }}}
-** create the form configuration in struts-config.xml for the form-names, e.g. for 
ValidatorForms:
+ ** create the form configuration in struts-config.xml for the form-names, e.g. for 
ValidatorForms:
 {{{
 
 
 }}}
-** or for DynaValidatorForms (we have to specify the fields we want here - and it's 
best to stick to Strings rather than trying to deal with Integers or Dates etc which 
do not get populated if the user enters the wrong type of data):
+ ** or for DynaValidatorForms (we have to specify the fields we want here - and it's 
best to stick to Strings rather than trying to deal with Integers or Dates etc which 
do not get populated if the user enters the wrong type of data):
 {{{
 
@@ -34,7 +34,7 @@
 
 }}}
 
-** configure the action mapping e.g.:
+ ** configure the action mapping e.g.:
 {{{
 
 
 }}}
-*** set validate=true 
-*** set input=/my/path  so that struts can send the request somewhere on 
validation-failure - this can be another action path like the example above, or a 
tiles definition (normally beginning with '.'), or any other page in your app.
-*** add form-name as 'name' attribute
-*** set the scope to request, or if you want to make use of 'work-flow' or 'wizard' 
techniques or other patterns that allow you to accumulate data over several HTTP 
requests, put 'session' instead.
+ *** set validate=true 
+ *** set input=/my/path  so that struts can send the request somewhere on 
validation-failure - this can be another action path like the example above, or a 
tiles definition (normally beginning with '.'), or any other page in your app.
+ *** add form-name as 'name' attribute
+ *** set the scope to request, or if you want to make use of 'work-flow' or 'wizard' 
techniques or other patterns that allow you to accumulate data over several HTTP 
requests, put 'session' instead.
 
-* create validation.xml config file in WEB-INF - using the same form names as in 
struts-config.xml e.g.:
+ * create validation.xml config file in WEB-INF - using the same form names as in 
struts-config.xml e.g.:
 {{{
 
   
@@ -79,27 +79,27 @@
 
 }}}
 
-* This validation.xml snippet is up-to-date as of validator-1.1, but changes are in 
the pipeline for localization, resource bundles etc and some xml attributes may be 
deprecated. 
+ * This validation.xml snippet is up-to-date as of validator-1.1, but changes are in 
the pipeline for localization, resource bundles etc and some xml attributes may be 
deprecated. 
 
-* get validator-rules.xml from the struts installation, in the conf/share/ directory 
and put it in WEB-INF
+ * get validator-rules.xml from the struts installation, in the conf/share/ directory 
and put it in WEB-INF
 
-* and now on to the JSPs. First of all, none of the tags will work unless you have 
their taglib declaration at the top of your page so:
+ * and now on to the JSPs. First of all, none of the tags will work unless you have 
their taglib declaration at the top of your page so:
 {{{
   <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html"; %>
 }}}
-* use html:form in the JSPs whose forms will be validated, e.g.:
+ * use html:form in the JSPs whose forms will be validated, e.g.:
 {{{
   
 }}}   
-* to enable client-side validation:
-** make sure you include the onsubmit attribute with the html:form tag 
+ * to en

[Jakarta Commons Wiki] New: ValidatorSetup

2004-05-20 Thread commons-dev
   Date: 2004-05-20T12:59:28
   Editor: RobertBurrellDonkin <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: ValidatorSetup
   URL: http://wiki.apache.org/jakarta-commons/ValidatorSetup

   Moved from original wiki

New Page:

This is a basic 1,2,3 guide that anyone can expand upon when they have something 
useful to add:\

* get commons-validator.jar - go to [http://jakarta.apache.org/ jakarta] to download 
the latest version.

* put it in your classpath - this is normally WEB-INF/lib/ along with the other jars 
such as struts.jar

* create action forms to be validated - based on ValidatorForm, or just use 
DynaActionForms and don't worry about coding classes for them - all that's needed is 
the form config in struts-config.xml (see below)

* edit your struts-config.xml:

** put the validator plug-in xml into the plug-ins section:
{{{


  

}}}
** create the form configuration in struts-config.xml for the form-names, e.g. for 
ValidatorForms:
{{{


}}}
** or for DynaValidatorForms (we have to specify the fields we want here - and it's 
best to stick to Strings rather than trying to deal with Integers or Dates etc which 
do not get populated if the user enters the wrong type of data):
{{{

  
  

}}}

** configure the action mapping e.g.:
{{{

  
  
  
  

}}}
*** set validate=true 
*** set input=/my/path  so that struts can send the request somewhere on 
validation-failure - this can be another action path like the example above, or a 
tiles definition (normally beginning with '.'), or any other page in your app.
*** add form-name as 'name' attribute
*** set the scope to request, or if you want to make use of 'work-flow' or 'wizard' 
techniques or other patterns that allow you to accumulate data over several HTTP 
requests, put 'session' instead.

* create validation.xml config file in WEB-INF - using the same form names as in 
struts-config.xml e.g.:
{{{

  

  

  
  


  datePattern
  -MM-dd

  

  

}}}

* This validation.xml snippet is up-to-date as of validator-1.1, but changes are in 
the pipeline for localization, resource bundles etc and some xml attributes may be 
deprecated. 

* get validator-rules.xml from the struts installation, in the conf/share/ directory 
and put it in WEB-INF

* and now on to the JSPs. First of all, none of the tags will work unless you have 
their taglib declaration at the top of your page so:
{{{
  <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html"; %>
}}}
* use html:form in the JSPs whose forms will be validated, e.g.:
{{{
  
}}}   
* to enable client-side validation:
** make sure you include the onsubmit attribute with the html:form tag 
{{{
  
focus="optionText"
onsubmit="return validateForm(this);">
}}}   
** include in the JSP the html:javascript tag with the same form-name as above and 
dynamic=true
{{{
  
}}}
** the 'method' should be the same as what you specified for the html:form onsubmit 
attribute.

* you could set static=true there as well, but it is more efficient to create an extra 
page with just that taglib in it, set to produce only static javascript (needs no 
form-name then) - and refer to it from your JSP using  tags. This way, the 
browser will cache it and reduce traffic.
{{{