. Here's a sample from the xml file:
validators
field name=user.firstName
field-validator type=required short-circuit=true
messagePlease enter your first name./message
/field-validator
field-validator type=regex short-circuit=true
-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 10:54 AM
To: Struts Users Mailing List
Subject: Re: short-circuit=true not working in field validator
--- Chamara Gunaratne [EMAIL PROTECTED] wrote:
I am using struts2 to validate form input
by what Im seeing from XWork validators the first 'required' validator you
declared is unnecessary as the second regex validator will identify that
condition
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/va
lidator/Validator.html
Anyone?
M-
- Original Message
-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 12:38 PM
To: Struts Users Mailing List
Subject: Re: short-circuit=true not working in field validator
by what Im seeing from XWork validators the first 'required' validator you
declared
Chamara Gunaratne wrote:
Dave:
Thank you for your reply. I changed type attribute to requiredstring. But
it doesn't help with the short-circuit problem.
Yes, both the first name and last name validators fire successfully and the
regex is correctly evaluated. Just the short-circuit part is not
Is anybody using the short-circuit attribute in the validations
successfully?
-Original Message-
From: Chamara Gunaratne [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 12:56 PM
To: 'Struts Users Mailing List'
Subject: RE: short-circuit=true not working in field validator
--- Chamara Gunaratne [EMAIL PROTECTED] wrote:
Is anybody using the short-circuit attribute in the validations
successfully?
Yes.
I'm not in front of my dev machine so I can't do much more at the moment. I
don't recall seeing anything wrong with your configuration.
Dave
: Re: short-circuit=true not working in field validator
Chamara Gunaratne wrote:
Dave:
Thank you for your reply. I changed type attribute to requiredstring.
But
it doesn't help with the short-circuit problem.
Yes, both the first name and last name validators fire successfully and
the
regex
PROTECTED]
Sent: Friday, February 29, 2008 4:16 AM
To: user@struts.apache.org
Subject: Re: expression validator
Thanks, I confirmed my syntax, and now it does not do any client side
validation. Do I have this validator in the right place? Here is the
relevant code from my xml file:
!DOCTYPE
'
Subject: RE: expression validator
Hi,
You can override the default functionality and use , create the
validator.xml such that is can compare strings.
Refer the following site ,
http://struts2issues.blogspot.com/
this will give a complete idea of doing it.
Thanks .
-Original Message
--- Deepak Kumar [EMAIL PROTECTED] wrote:
Here is very good example with running source code.
http://www.roseindia.net/struts/struts2/struts-2-client-side-validation-example.shtml
Hmm, that doesn't seem to do client-side expression validation either, unless
I missed it. Perhaps you can point it
--- mojoRising [EMAIL PROTECTED] wrote:
Thanks. But I still don't understand...According to the link you mentioned
it is not possible to do what I was trying to. So, what is the point of
this
validator if it doesn't do client side validation?
Because there are other places to do validation
declare the field validator such as the field-name declared in validators in
FieldValidatorsExampleAction-submitClientSideValidationExample-validation.xm
l
validators
field name=requiredStringValidatorField
field-validator type=requiredstring
param name=trimtrue/param
Thanks. But I still don't understand...According to the link you mentioned it
is not possible to do what I was trying to. So, what is the point of this
validator if it doesn't do client side validation? And, are you saying that
it is not possible to do a simple 'equals' test in client side
, because it doesn't address the question at all.
declare the field validator such as the field-name declared in validators
in
FieldValidatorsExampleAction-submitClientSideValidationExample-validation.xm
l
validators
field name=requiredStringValidatorField
field-validator type
One of the things I love about Struts is that you get validation without
writing any real validation code. Admittedly it would be nice if you got
client side validation for expressions. As you know you can create a custom
validator and for the client side stuff you would have to edit
form-close
Hi,
yes. this is what i did for one of the project i am bit involved.
1. wrote a custom validator
public class PasswordConfirmValidator extends FieldValidatorSupport {
private static Log log =
LogFactory.getLog(PasswordConfirmValidator.class);
private String fieldName2;
public
Thanks, I confirmed my syntax, and now it does not do any client side
validation. Do I have this validator in the right place? Here is the
relevant code from my xml file:
!DOCTYPE validators PUBLIC
-//OpenSymphony Group//XWork Validator 1.0.2//EN
http://www.opensymphony.com
That validator doesn't do client side validation.
Only the following validators are supported:
* required validator
* requiredstring validator
* stringlength validator
* regex validator
* email validator
* url validator
* int validator
* double validator
http
26, 2008 11:00 PM
To: 'Struts Users Mailing List'
Cc: [EMAIL PROTECTED]; 'Mano Dasanayaka'
Subject: Need Help Creating a Custom Validator
Hi all,
Can any one suggest me a good article that describes adding a custom
validator and how to configure. Sample code along with required
configurations
a custom
validator and how to configure. Sample code along with required
configurations is also appreciated.
I'd recommend looking at [1] and any of the included validators--whichever
one comes the closest to whatever it is you're trying to validate. [2] is a
WebWork article that goes into a bit
Hello. Where can I find these files for Struts 1.3.8?
- Asad
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Asad Habib wrote:
Hello. Where can I find these files for Struts 1.3.8?
They're packaged inside the struts.jar file.
L.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi all,
Can any one suggest me a good article that describes adding a custom
validator and how to configure. Sample code along with required
configurations is also appreciated.
Thanks In Advance.
Mano
-
To unsubscribe, e
/action
/struts
Thanks,
Neha
--
View this message in context:
http://www.nabble.com/Differentiate-Redirection-of-page-if-validator-fails-and-action-property-setter-fails.-tp15560564p15560564.html
Sent from the Struts - User mailing list archive at Nabble.com
Can some Struts guru answer the following questions?
-Original Message-
From: Zhang, Larry (L.)
Sent: Thursday, January 31, 2008 3:27 PM
To: 'Struts Users Mailing List'
Subject: Struts validator
Hello coworkers,
I have a questions regarding the struts validation..., say I have three
validator
Can some Struts guru answer the following questions?
-Original Message-
From: Zhang, Larry (L.)
Sent: Thursday, January 31, 2008 3:27 PM
To: 'Struts Users Mailing List'
Subject: Struts validator
Hello coworkers,
I have a questions regarding the struts validation..., say I have
We are not using Struts 2 tag and thus I can't use s:submit tag.
-Original Message-
From: David Harland [mailto:[EMAIL PROTECTED]
Sent: Friday, February 01, 2008 10:01 AM
To: Struts Users Mailing List
Subject: RE: Struts validator
You can do it by having 3 different methods
--- Zhang, Larry (L.) [EMAIL PROTECTED] wrote:
We are not using Struts 2 tag and thus I can't use s:submit tag.
Are you using Struts 2 at all?
You can still use the generated HTML as a template to create your own HTML,
although... not sure why you wouldn't just use the tag in this case.
Dave
Struts valdiator developers, Doesn't struts support this requirment?
-Original Message-
From: Zhang, Larry (L.)
Sent: Friday, February 01, 2008 10:55 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts validator
No, I am using struts 1.1, I would like to implement the following case
fields at the same time when just one
submit button is clicked. Your helps are appreciated!
-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Friday, February 01, 2008 10:45 AM
To: Struts Users Mailing List
Subject: RE: Struts validator
--- Zhang, Larry (L.) [EMAIL
Hello coworkers,
I have a questions regarding the struts validation..., say I have three
text fields to be validated in struts validation, and three submit
buttons as well. When I submit one buttion, I only need to validate one
field, and when I click on the other submit button, I need to
Hi all,
HDIV 2.0.3 has just been released including new features.
HDIV project is an Apache-licensed Java Web Application Security Framework that
adds security functionalities to Struts 1.x, Struts 2.x, Spring MVC and JSTL in
a transparent way to the programmer and without adding any complexity
Hi,
I want to access value of property a while giving an error message for
value of property b. e.g. my error message should be For value b,
value a is not in the range .
where both a and b are different properties,
Is there any way that I can do that ?
Thanks,
Kavita
'required' validator worked.
But now I want show error message when user will put string or character
instead of any long value. What validator to use?
If you're using the defaultStack this is done for you; type conversion
errors
will be added to the field errors via the conversion interceptor
Hi Folks,
just slogging my way up the learning curve of XWorks Validation with
that 'here we go again' feeling, and it occurred to me that I might be
able to plug in the old commons-validator more quickly.
XWorks's Struts2 validation framework is probably not that bad and of
course commons
--- Adam Hardy [EMAIL PROTECTED] wrote:
- is there a way to have all the validation in one config file rather
than having one config file per Action class?
AFAICT the validation files are looked up the same way the resource files
are; for example I just added a superclass to one of my actions,
Thank you Laurie ,
Using 'Long' is the correct way to get 'required' validator worked.
But now I want show error message when user will put string or character
instead of any long value.
What validator to use?
On Dec 11, 2007 7:13 PM, Laurie Harper [EMAIL PROTECTED] wrote:
The 'requiredstring
problems (similar approach, but with
more control).
So, you really don't have to do much (other than formatting the message
if the default doesn't suit your needs)
Arpan Debroy wrote:
Thank you Laurie ,
Using 'Long' is the correct way to get 'required' validator worked.
But now I want show
There is a convince validator for types that uses the backing type errors to
generate validation errors. I use it to ensure that letters aren't entered in
my number fields.
The annotation is ConversionErrorFieldValidator
For example:
@ConversionErrorFieldValidator(message=Please enter only
--- Arpan Debroy [EMAIL PROTECTED] wrote:
Using 'Long' is the correct way to get 'required' validator worked.
But now I want show error message when user will put string or character
instead of any long value. What validator to use?
If you're using the defaultStack this is done for you; type
The 'requiredstring' validator will check for both not-null and
not-empty, where 'required' only checks for non-null. If you're using a
numeric primitive type (i.e. 'long' rather than 'Long'), you can never
have a null value, so required can never fail. In that case, you need to
specify range
Do you have the Validation Interceptor on your Stack?
Arpan Debroy schrieb:
I want to validate -
1) The text box should have some value(required validator doesn't show any
error message even if it's empty)..
2) The text box must have any numerical(I am using long data type) value. I
have
Yeah,
I am using following -
interceptor-ref name=validationWorkflowStack/
Other validators are working.
Anyway have anyone ever used required validator or can you use it now once
to test.
Thanks
On Dec 10, 2007 5:26 PM, Simon Berger [EMAIL PROTECTED] wrote:
Do you have the Validation
AFAIK the required validator only checks for not-null.
This is almost never what you want, as an empty text box will still send back
an empty string, not null.
d.
--- Arpan Debroy [EMAIL PROTECTED] wrote:
Yeah,
I am using following -
interceptor-ref name=validationWorkflowStack/
Other
Use required validator only when a field contains a number. Use
requiredstring for String based field.
-Original Message-
From: Arpan Debroy [mailto:[EMAIL PROTECTED]
Sent: Monday, December 10, 2007 11:00 AM
To: Struts Users Mailing List
Subject: Re: Required validator dosen't work
Then when you will use required validator. What's its use? Have you ever
used it.
How to validate the text box,which should carry numbers?
On Dec 10, 2007 10:40 PM, Dave Newton [EMAIL PROTECTED] wrote:
AFAIK the required validator only checks for not-null.
This is almost never what you want
Yeah..I am using numbers only.The required validator not working for
numbers also.
If you want you can test it quickly.
On Dec 10, 2007 11:01 PM, Jiang, Jane (NIH/NCI) [C] [EMAIL PROTECTED]
wrote:
Use required validator only when a field contains a number. Use
requiredstring for String based
--- Arpan Debroy [EMAIL PROTECTED] wrote:
Then when you will use required validator. What's its use?
Anything that can return null, like a checkbox, I suppose. Yes, I've used it,
but not for numbers, because an empty text box doesn't return null, like I
said.
How to validate the text box,which
So that means there is now way I can check if
a text box, which takes the datatype long, have any null value.
On Dec 10, 2007 11:40 PM, Dave Newton [EMAIL PROTECTED] wrote:
--- Arpan Debroy [EMAIL PROTECTED] wrote:
Then when you will use required validator. What's its use?
Anything that can
--- Arpan Debroy [EMAIL PROTECTED] wrote:
So that means there is now way I can check if
a text box, which takes the datatype long, have
any null value.
For *null*? A text box in the browser will never* send back a null to the
server, AFAIK. IIRC in Java converting an empty string into a
Right, if my text box is empty, I am getting back 0 allways.
Have u any idea, how to validate empty long data type value.
On Dec 11, 2007 12:51 AM, Dave Newton [EMAIL PROTECTED] wrote:
--- Arpan Debroy [EMAIL PROTECTED] wrote:
So that means there is now way I can check if
a text box, which
Checked my validation files, I've only used required validator for
selection and checkboxes that contains number value.
How about set required=true for your textfield?
-Original Message-
From: Arpan Debroy [mailto:[EMAIL PROTECTED]
Sent: Monday, December 10, 2007 2:33 PM
To: Struts
I want to validate -
1) The text box should have some value(required validator doesn't show any
error message even if it's empty)..
2) The text box must have any numerical(I am using long data type) value. I
have no clue how to do it for long.
Can anyone please help..
Thanks
On Dec 6, 2007 1
-validator type=required
messageapp id should not be null/message
/field-validator
/field
Here channelGroupTO is a transfer object, which I am referencing in Action
class. So all the values get populated automatically. assocAppID is a long
attribute. Actually I used required type
The symptom of the problem is that required validator does not work at
all.
What a required validator should do?
If I don't put any value in the text box, it should throw an error message.
The required validator doesn't work
for any type of value. Can anybody use this validator successfully
required=true
name=channelGroupTO.assocAppID theme=simple size=8
value=%{channelGroupTO.assocAppID}//td
in validation xml :-
field name=channelGroupTO.assocAppID
field-validator type=required
messageapp id should not be null/message
/field-validator
/field
Here
Hi all,
I am trying to use required validator in struts2.
But it seems this one dosen't work at all.
Have anybody successfully used required validator.
Thanks
--
View this message in context:
http://www.nabble.com/Required-validator-dosen%27t-work-tf4952011.html#a14179533
Sent from the Struts
--- xniit2003 [EMAIL PROTECTED] wrote:
I am trying to use required validator in struts2.
But it seems this one dosen't work at all.
Have anybody successfully used required validator.
What data type are you attempting to validate?
d
xniit2003 wrote:
Have anybody successfully used required validator.
Yes.
One thing to note about validation is that it *won't* automatically
short-circuit if you're not using the workflow interceptor. Without
that interceptor validation can fail and your action's execute method
will still
Hi,
I want to use the Spring validation framework in Struts2 action classes.
Has such an integration already been done in a project?
Thanks a lot!
Joachim
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
--- Mike Duffy [EMAIL PROTECTED] wrote:
Does anyone have a great solution for a validator
that will prevent users from entering malicious SQL
into form entry text fields?
I'm not sure that belongs in a validator; unless you
never need to allow the use of a single quote. It is,
hoever unlikely
Does anyone have a great solution for a validator that will prevent users from
entering malicious SQL into form entry text fields?
Thx.
Mike
Get easy, one-click access to your favorites.
Make Yahoo
Mike-
There are actually 2 situations to be mindful of
(Not a salesman for these folks but acutenix had a very good tutorial)
SQLInjection
Solution might use a JS Validator..
but just in case JS validator passes it on the Server side to look for AND
/OR funky conditional 1=1 comes to mind
=0postorder=asc
And page 16 of the following link:
http://www.net-security.org/dl/articles/IntegrigyIntrotoSQLInjectionAttacks.pdf
Thx.
Mike
--- On Thu, 11/15/07, Antonio Petrelli [EMAIL PROTECTED] wrote:
From: Antonio Petrelli [EMAIL PROTECTED]
Subject: Re: Struts Validator to Prevent SQL
Dave Newton wrote:
--- Mike Duffy [EMAIL PROTECTED] wrote:
Does anyone have a great solution for a validator
that will prevent users from entering malicious SQL
into form entry text fields?
I'm not sure that belongs in a validator; unless you
never need to allow the use of a single quote
.).
Has anyone created an elegant solution for this problem within the Struts
framework?
Mike
--- On Thu, 11/15/07, Dave Newton [EMAIL PROTECTED] wrote:
From: Dave Newton [EMAIL PROTECTED]
Subject: Re: Struts Validator to Prevent SQL Injection Attacks
To: Struts Users Mailing List user
that), then you're not covered.
But if you use the placeholder and HQL or the Criteria APIs, then
you're covered.
Mike
--- On Thu, 11/15/07, Gary Affonso [EMAIL PROTECTED] wrote:
From: Gary Affonso [EMAIL PROTECTED]
Subject: Re: Struts Validator to Prevent SQL Injection Attacks
To: Struts Users
2007/11/15, Mike Duffy [EMAIL PROTECTED]:
No matter where this is done, the basic problem is we have single quotes,
double quotes, ampersands, semicolons, and parenthesis in our data.
This may be off topic, but does not is suffice to use prepared
statement and parameters to avoid such attacks?
2007/11/15, Mike Duffy [EMAIL PROTECTED]:
Prepared statements if created correctly will work, but if your statements
are created dynamically with text strings as the values instead of ?
placeholders problems can occur.
I wonder why do you create query strings this way: you can always
create
Thx Gary.
That is good information.
We are actually using JBoss with EJB 3.0, which uses Hibernate under
the covers, so I am assuming we are covered.
Mike
--- On Thu, 11/15/07, Gary Affonso [EMAIL PROTECTED] wrote:
From: Gary Affonso [EMAIL PROTECTED]
Subject: Re: Struts Validator
Thx.
Mike
--- On Thu, 11/15/07, Antonio Petrelli [EMAIL PROTECTED] wrote:
From: Antonio Petrelli [EMAIL PROTECTED]
Subject: Re: Struts Validator to Prevent SQL Injection Attacks
To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED]
Date: Thursday, November 15, 2007
I modified the quickstart demo application by adding person.dateOfBirth
and person.age to do some tests with the validators.
I added a an intrange validator on the age and a daterangevalidator
and a regex validator on the date of birth plus
additional required validators on the new
I wonder what the purpose is of returning false.
On 10/30/07, John Doe [EMAIL PROTECTED] wrote:
I've solved the problem. The only way to validate properly is to add an
error to the errors variable. Without this validator will think that
everything is OK even if you returned false in validate
I know there are several threads about this topic, but I found no solution
for my case:
I have model-driven action:
model
... getModel() ...
return model;
and some actions, lets say:
actionA() ...
actionB() ...
Now the following facts:
I have to use visitor field validator
I've solved the problem. The only way to validate properly is to add an
error to the errors variable. Without this validator will think that
everything is OK even if you returned false in validate method.
On 10/29/07, John Doe [EMAIL PROTECTED] wrote:
No, there is no exception.
On 10/28/07
No, there is no exception.
On 10/28/07, Paul Benedict [EMAIL PROTECTED] wrote:
I think validation can pass if an exception is thrown. Please check your
log
files that no error is occurring with your validation.
Paul
--
Best regards,
Bashmaкov Anton
I think validation can pass if an exception is thrown. Please check your log
files that no error is occurring with your validation.
Paul
Yes. I have validation working correctly. Required and mask works good. And
my validator method gets called and returns false, but I do not add any
errors message is it necessary?
On 10/26/07, Laurie Harper [EMAIL PROTECTED] wrote:
John Doe wrote:
Hi,
I have Struts 1.2.7 application and I
Hi,
I have Struts 1.2.7 application and I need to write custom validator for my
form. I've wrote struts tutorial at
http://struts.apache.org/1.2.7/userGuide/dev_validator.html
and have tried to do the same. But my validator is not working. Here is my
class method :
public class GroupIdValidator
John Doe wrote:
Hi,
I have Struts 1.2.7 application and I need to write custom validator for my
form. I've wrote struts tutorial at
http://struts.apache.org/1.2.7/userGuide/dev_validator.html
and have tried to do the same. But my validator is not working. Here is my
class method :
public class
entered needs to be validated. What about having validators like
intRequired instead of two different validators? This way we could pick
from a smarter validator crop and let the magic happen there.
Scott
--
View this message in context:
http://www.nabble.com/validator-shortcuts-idea-tf4636405
* be
required, but
once entered needs to be validated. What about having validators like
intRequired instead of two different validators? This way we could
pick
from a smarter validator crop and let the magic happen there.
Scott
--
View this message in context: http://www.nabble.com/validator
Hi,
Within a custom validator for field1, i need access to another field, say
field2 to perform some comparison. getFieldValue(field2, object) does not
help. Please advise.
Thanks,
Joseph
I don't the client-side validator handles arrays? You should instead allow
server-side validation to take care of complex scenarios.
Paul
On 9/12/07, Matthew Schrader [EMAIL PROTECTED] wrote:
Users,
I have been googling like crazy to find a workaround, or fix, to the
problem of Validator
I have my beans inheriting ValidtorActionForm. Is there anything else
that I need to do to turn on server-side validation? At this point
neither server-side or client-side validation is picking up this field.
Paul Benedict wrote:
I don't the client-side validator handles arrays? You should
Users,
I have been googling like crazy to find a workaround, or fix, to the
problem of Validator not working properly with nested:iterate fields.
Below I have included what I am doing for the code incase I have
something wrong. Please let me know if anyone knows anything.
My field is set
=mask key=ProcessorHTTPDetails.in.help/
var
var-namefield[0]/var-name
var-valueeditParams/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNOTNULL/var-value
/var
/field
But now in S2, there is no requiredif validator :(
Any idea about how can I do
Manchester
M2 3LS
-Original Message-
From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED]
Sent: Friday, September 07, 2007 12:30 PM
To: user@struts.apache.org
Subject: Requiredif validator
Hi all!
I´m trying to validate two fields that depends on another field.
What I was doing in S1
Hi Richard,
Looking at http://struts.apache.org/2.x/docs/validation.html I don´t see
there was validwhen validator...
Besides that, the example you gave me is for Struts 1, isn´t it? I need
an Strut2 one.
Thanks.
Gundersen, Richard escribió:
Hi Pablo
Try using validwhen instead - I think
Yes. Thats right.
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Paul Benedict
Gesendet: Mittwoch, 29. August 2007 23:05
An: Struts Users Mailing List
Betreff: Re: STRUTS 1.3.8 Validator ist destroying my SessionToken
Are you saying
. August 2007 23:05
An: Struts Users Mailing List
Betreff: Re: STRUTS 1.3.8 Validator ist destroying my SessionToken
Are you saying the execute() method is being called even when validation
fails?
On 8/29/07, [EMAIL PROTECTED]
[EMAIL PROTECTED]
wrote:
It is true.. I guess.
When the Struts
It is true.. I guess.
When the Struts-Validation fails, the following action-class is still executed
- leading to the isTokenValid() Method being
Used.
The strange thing is : the process stops after the first action-class and
returns the validator-errors to the screen.
I found a way to forward
.
The strange thing is : the process stops after the first action-class and
returns the validator-errors to the screen.
I found a way to forward the request-Token to the following action-class.
So I'm able to test the token after the half-broken-validator did his test.
But it's not the way I imagined
Hi,
Im using the struts-Validator AND the transaction Token. Both work
perfectly - BUT if I use them in combination I'm in trouble...
If the validator detects wrong data and returns me to the input-form it
still starts the actionclass of the submit button - and its executing
isTokenValid
On 8/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
If the validator detects wrong data and returns me to the input-form it
still starts the actionclass of the submit button - and its executing
isTokenValid() .
This can't be true. If you're using automatic validation, the action
/**
* This expression derived/taken from the BNF for URI (RFC2396).
*/
private static final String URL_PATTERN =
/^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;
the above regexp is what the validator seems to use to validate urls.
For more information
== null) {
setDefaultMessage(Start Year is a required field.);
addFieldError(_startFieldName, object);
}
Seems to solve the problem.
However, I did discover something strange. If a NPE is thrown in my
validator, the exception is swallowed. Any ideas on what could be causing
Could it be because http://google isn't a valid URL?
Many browsers add .com, .net etc to the end of what you type and look for
the first thing that gets a response, but that is browser behaviour, and the
url validator should reject http://google because it isn't a valid URL.
-Original
Does anybody know if I can use Struts Url Validator for intranet url?
For exampe: http://intranet or http://localhost:8080
I'm pretty sure it doesn't try to resolve the machine, or do a DNS
lookup in order to determine if the url is valid. One could conceive of
building something that did
301 - 400 of 1759 matches
Mail list logo