Prashanth.S wrote:

Hi all,
I need to upload a resource present at a particular location by making user enter a 
valid URL...How can i do URL name validation using struts???Is there anything to do 
so??Do i need to do this in action form or action class??[what User entered is a valid 
url i.e,both name as well as resource present at that url)

The current commons-validator has a java class for validating a URL that I added,
it is pretty extensive. I still need to write the equalivent Javascript. Look at the unit
tests for how to use the class. Alternatively you can go to javascript.com to find
a standalone version for javascript. Usually when we create the Javascript version
it mirrors the java version so the two give the same results.


The JavaDoc on the web site is really old so look at the source:
http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/share/org/apache/commons/validator/UrlValidator.java

The Unit tests:
http://cvs.apache.org/viewcvs/jakarta-commons/validator/src/test/org/apache/commons/validator/UrlTest.java

Download the nightly which has all the below plus updated javadocs
http://cvs.apache.org/builds/jakarta-commons/nightly/commons-validator/

Since method signatures have changed in commons-validator,
the easiest way to get this though is to download a *nightly* version of struts:(**recommended**)


http://cvs.apache.org/builds/jakarta-struts/nightly/

Thanks in advance
Prashanth



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!





Reply via email to