You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Franck Wiegner <fw...@exa-online.de> on 2005/05/04 13:25:20 UTC

Validation Problem with depends=URL

Hey,

 

i am trying to validate the input of a form bean containing various fields.
One of the fields requires the entry of an URL.

The field-tag in my validation.xml looks like that:

 

<field property="otherProperty(webURL)" depends="required,url">

      <msg name="required" key=" errors.required"/>

      <msg name="url" key="errors.url"/>

      <arg key=" webURL" position="0"/>  

      <var>

            <var-name>allowallschemes</var-name>

            <var-value>false</var-value>

      </var>

      <var>

            <var-name>schemes</var-name>

            <var-value>http</var-value>

      </var>

</field>

 

Validation works just fine with all the other fields, but not with this one.
When I leave it empty, I get an error-msg, that's okay, when i enter an
invalid url I also get an error-msg, still okay. but when I enter a valid
url (example:  <http://www.myurl.com/> http://www.myurl.com) I also get the
message that this is an invalid url, which is not okay, cause as long as I
am not able to enter valid urls my form bean will never parse.

 

What am I doing wrong? Why is struts telling me that every valid url I enter
is invalid?

 

Best regards

Franck

 


Re: Validation Problem with depends=URL

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
This is a bug in validator:

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

Niall

----- Original Message ----- 
From: "Günther Wieser" <gw...@creative-it.com>
Sent: Wednesday, May 04, 2005 7:46 PM


as franck is in my team, i can answer this question on behalf of franck.

i think there went something wrong with the formatting of his email, of
course he types in "http://www.myurl.com" (yes, without the quotes), but
whatever we enter, we get a validation error that this is not a valid url.
as far as i've seen it, it doesn't matter which scheme we use, e.g. an ftp
url also fails. tested on two different machines, which are almost 1000km
away from each other, so no chance that the bad spirit of one machine
reaches the other one ;-)



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Validation Problem with depends=URL

Posted by Günther Wieser <gw...@creative-it.com>.
hi,

as franck is in my team, i can answer this question on behalf of franck.

i think there went something wrong with the formatting of his email, of
course he types in "http://www.myurl.com" (yes, without the quotes), but
whatever we enter, we get a validation error that this is not a valid url.
as far as i've seen it, it doesn't matter which scheme we use, e.g. an ftp
url also fails. tested on two different machines, which are almost 1000km
away from each other, so no chance that the bad spirit of one machine
reaches the other one ;-)

kr,
guenther


--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com


-----Original Message-----
From: Dave Newton [mailto:newton@pingsite.com] 
Sent: Wednesday, May 04, 2005 4:35 PM
To: Struts Users Mailing List
Subject: Re: Validation Problem with depends=URL

Franck Wiegner wrote:

>invalid url I also get an error-msg, still okay. but when I enter a 
>valid url (example:  <http://www.myurl.com/> http://www.myurl.com) I 
>also get the message that this is an invalid url, which is not okay, 
>cause as long as I am not able to enter valid urls my form bean will never
parse.
>  
>
What happens if you just enter "http://www.myurl.com" (without the quotes,
of course)?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validation Problem with depends=URL

Posted by Dave Newton <ne...@pingsite.com>.
Franck Wiegner wrote:

>invalid url I also get an error-msg, still okay. but when I enter a valid
>url (example:  <http://www.myurl.com/> http://www.myurl.com) I also get the
>message that this is an invalid url, which is not okay, cause as long as I
>am not able to enter valid urls my form bean will never parse.
>  
>
What happens if you just enter "http://www.myurl.com" (without the 
quotes, of course)?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org