Hi Prashanth,

I have done this using the Struts validator. I use the mask rule as
follows:

        <form name="serviceProviderForm">
                <field property="URL" depends="required,mask">
                        <msg name="mask"
key="error.invalid.ServiceProviderURL"/>
                        <arg0 key="serviceProvider.url"/>
                        <var>
                        <var-name>mask</var-name>
                                <var-value>^http:\/\/[^ ]*$</var-value>
                        </var>
                </field>
        </form>

There are great examples of using the validator in the Struts
distribution. With this my code need not be concerned with the validity
of the url string and is check by the validation framework on both
client side(JavaScript) and server side and I only worry about errors
obtaining a connection to the supplied url.

Cheers,

Greg

-----Original Message-----
From: Prashanth.S [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 9:36 AM
To: [EMAIL PROTECTED]
Subject: URL validation with struts???

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)
Thanks in advance
Prashanth



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


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

Reply via email to