As a starting point you may check the freemarker .ftl files from the
XHTML template.
2010/1/8 Robby Atchison rob...@msn.com:
Hello, I would like to know how an actionname-validation.xml is tied to the
client-side validation. I figure somewhere the xml file is read and
Javascript is output.
Hello, I would like to know how an actionname-validation.xml is tied to the
client-side validation. I figure somewhere the xml file is read and
Javascript is output. I'm having trouble connecting the dots. Any
information and help will be appreciated.
Best regards!
Robby
My application user has to insert a monetary value for an invoice.
Can I use the v alidator to check the value to be greater than 0, but without
specifying a max value?
How do I use validation in an [Action]-validation.xml file to validate
several fields?
I need to implement the following logic for 3 fields on a form:
Company, FirstName, LastName.
Psedo Code:
If Company empty, then FirstName and LastName must be filled
If FirstName and LastName empty, then
if you want javascript validation you will have to create your own theme and
own validation. You will have to create your own validator class and modify
the form-close-validation.ftl. This is what I've done in the past. Once you
figure out the details you start creating and reusing validators.
On
Implement Valiadateable in your action and the Workflow interceptor will
call validate() before and action method If your validate() method adds
ActionErrors then the messages go back to the input form. You will also
need to configure / annotate an input result. I can't remember off the
top of
:06 PM
To: Struts Users Mailing List
Subject: Advanced Struts 2 Validation Question...
How do I use validation in an [Action]-validation.xml file to validate
several fields?
I need to implement the following logic for 3 fields on a form:
Company, FirstName, LastName.
Psedo Code:
If Company empty
--- On Thu, 11/13/08, Burton Rhodes wrote:
How do I use validation in an [Action]-validation.xml file
to validate several fields?
I need to implement the following logic for 3 fields on a
form: Company, FirstName, LastName.
Psedo Code:
If Company empty, then FirstName and LastName must
Thanks to all! Implementing Validatable was simple and works great.
I am thinking of moving all my action objects that need it to
Validatable. per Bill's suggestion... one less file to worry about.
:)
On Thu, Nov 13, 2008 at 9:58 AM, Dave Newton [EMAIL PROTECTED] wrote:
--- On Thu, 11/13/08,
-Original Message-
From: Burton Rhodes [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2008 11:25 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Advanced Struts 2 Validation Question...
Thanks to all! Implementing Validatable was simple and works great.
I am thinking
Am Mittwoch, 8. Oktober 2008 20:27:40 schrieb Gabriel Belingueres:
You can do it by hand though:
Thx for this hint, should habe seen that myself. Thats a good idea to do stuff
with s:if and s:else myself. thx.
--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe
Hi.
I don't want to use the xhtml theme because of the table layout it produces,
the simple is enough.
However, simple does not render the validation errors or messages.
Wheres the glue to do so with the simple theme? Did not find any information
about this yet which helps me, to render those
2008/10/8 Torsten Krah [EMAIL PROTECTED]:
I don't want to use the xhtml theme because of the table layout it produces,
the simple is enough.
However, simple does not render the validation errors or messages.
You can use css_xhtml theme [1]
Wheres the glue to do so with the simple theme? Did
Hi,
you're right, simple theme don't allow you to use validation. In order
to use validation with the simple theme you have to extend it or to
modify xhtml theme in order not to build the table layout.
The templates sources are in struts jar and you can define others by
adding them to
You can do it by hand though:
s:if test=getFieldErrors() != null getFieldErrors()['myfield'] != null
s:fielderror
s:param value=%{'myfield'}/
/s:fielderror
/s:if
In addition, if you are using S2.1, then you have a basic error
handling. Each tag has an cssErrorClass and cssErrorStyle
Hi,
I have the below scenario in our application.
Consider we have two radio buttons for two types of bank accounts, say Savings
and Current, and based on the selection of each radio button we are
enabling/disabling some fields for user input, which in turn, the properties of
an ActionForm.
Hi,
I want to put a validation in struts2 using field-validator type=regex such
that any string which contains any of the , or any of the alternative
representation like lt; should return a validation failure message. How do I
do that?. I believe that if I give a pattern to regex, it shows
Pranav wrote:
Hi,
I want to put a validation in struts2 using field-validator type=regex such that any
string which contains any of the , or any of the alternative representation like lt;
should return a validation failure message. How do I do that?. I believe that if I give a pattern
to
Rather than use the validation framework, I'd probably go with a
Validate method (by implementing Validatable).
Then, instead of using an OGNL expression, you can loop through the
list using Java, and call addFieldError if there's a problem.
Alternatively, a custom type converter that turned the
On Jan 11, 2008 8:10 AM, Martin Braure de Calignon [EMAIL PROTECTED] wrote:
Of course yes :-). But I need a validate() per method.
I haven't used it myself, but the syntax validate-action is suppose to
work, in the same way that it works for the validation framework.
HTH, Ted
*
Le vendredi 11 janvier 2008 à 07:36 -0500, Ted Husted a écrit :
Rather than use the validation framework, I'd probably go with a
Validate method (by implementing Validatable).
Firstly, thank you very much for your answer :)
Ok then... That what I though... But my problem is that Validate() is
Le vendredi 11 janvier 2008 à 09:15 -0500, Ted Husted a écrit :
On Jan 11, 2008 8:10 AM, Martin Braure de Calignon [EMAIL PROTECTED] wrote:
Of course yes :-). But I need a validate() per method.
I haven't used it myself, but the syntax validate-action is suppose to
work, in the same way
The validation interceptor will look for, and call, validate${methodName}
(and validateDo${methodName}).
d.
--- Martin Braure de Calignon [EMAIL PROTECTED] wrote:
Le vendredi 11 janvier 2008 à 09:15 -0500, Ted Husted a écrit :
On Jan 11, 2008 8:10 AM, Martin Braure de Calignon [EMAIL
Le vendredi 11 janvier 2008 à 15:46 -0800, Dave Newton a écrit :
The validation interceptor will look for, and call, validate${methodName}
(and validateDo${methodName}).
d.
Great ! thank you all :-)
--
Martin Braure de Calignon
signature.asc
Description: Ceci est une partie de message
Hello,
I'm currently using struts2 for a project.
I want to validate all elements of a list (each elements should have a
non-empty value, or the list should be empty).
what I have done in my validator is :
!-- correct doctype above and some field-validator--
validator type=expression
Le mardi 08 janvier 2008 à 14:08 +0100, Martin Braure de Calignon a
écrit :
Sorry I've forgot [S2] in subject
Hello,
I'm currently using struts2 for a project.
I want to validate all elements of a list (each elements should have a
non-empty value, or the list should be empty).
what I
Downloaded and extracted the struts2-showcase-2.0.1.war file to my
tomcat server. I am looking at the validation/quizBasic!input.action
and I am confused on how the validtion on these fields is set. I am
accustomzed to using 1.x.
Could someone please explain how the validation for these three
S2 Validation follows a config-behind-class model. You define a
validation file for the Action class (or other JavaBean) that needs to
be validated, and place it in the same package/folder. The validation
follows the class hierarchy, so that if a class is extended, the
subclass inherits the
I want to use struts validation,when field is invalidate,my program can
raise information,like follows:
Username is required.
Password is required.
Phone Number is required.
I know it's server-side validation,I want to use client-side validation,so I
put some code in my JSP files:
/html:form
To: user@struts.apache.org
Subject: Struts validation question
I want to use struts validation,when field is invalidate,my program can
raise information,like follows:
Username is required.
Password is required.
Phone Number is required.
I know it's server-side validation,I want to use client-side
The short answer is that there isn't a way to echo back user input in the
error message. Most of the time I don't think its necessary to do so
anyway - since if you're re-displaying/highlighting errors then what is the
need. The one time I scenario I wanted to do something like that, was when I
I am using the struts validator and it works almost exactly the way I want.
Say I have a field tf and the value is ABC
I want to do a validation requiring it to be an integer and return the
following error message: tf must be an integer.
I can do all this pretty easily here is the code that
I would like to know the answer on this too. I searched the Net, all
examples use properties from property file. Using resource=false
does not help with either (neither?) of these variants:
arg0 key=nestedUser.fromAddress resource=false/
arg0 key=${nestedUser.fromAddress} resource=false/
arg0
I have a question about using request scoped beans and validation with an
ActionForm.
Here is a example:
In a certain action, I go and create a Collection of objects for a select
list. I put the Collection into the request, and forward to a JSP page, and
I show the list.
From the JSP page, the
The way I dealt with this was to point my input attribute to a setup
Action which would put the needed collection into request scope for
me. But that's just one approach. Another is to handle validation
yourself (which really is very easy). This is the approach
recommended by
I like the CSS 'trick' -- I will try it tonight !
Thanks again Wendy,
Regards, Alex.
On 7/22/05, Wendy Smoak [EMAIL PROTECTED] wrote:
From: Aleksandar Matijaca [EMAIL PROTECTED]
I would like
to automatically place a little red * right beside the input field.
For my password
Hi there,
I am currently using the struts validator, and it is working pretty good.
My basic error block looks like this:
logic:messagesPresent
table
tr
td colspan=2font color=redbean:message key=errorTitle
//font/td
/tr
html:messages id=error
tr
tdnbsp;nbsp;/td
tdfont color=redbean:write
You could add errorClassId on the input element and use CSS to insert an
image of a little red *... :-) I can't think of a clean way to find out if
an error exists for a particular property though. This might work (haven't
tried it):
c:if test=${not empty messages.message['property']}*/c:if
Thanks Laurie, I will try it !!
Cheers, Alex.
On 7/21/05, Laurie Harper [EMAIL PROTECTED] wrote:
You could add errorClassId on the input element and use CSS to insert an
image of a little red *... :-) I can't think of a clean way to find out if
an error exists for a particular property
It didn't work, but thanks for the effort Laurie...
Regards, Alex.
On 7/21/05, Laurie Harper [EMAIL PROTECTED] wrote:
You could add errorClassId on the input element and use CSS to insert an
image of a little red *... :-) I can't think of a clean way to find out if
an error exists for a
From: Aleksandar Matijaca [EMAIL PROTECTED]
I would like
to automatically place a little red * right beside the input field.
For my password confirmation field, wnen I put
html:errors property=confirm_password/
beside the text field, I get the WHOLE STRING for the 'required'
validation,
-Original Message-
From: N G [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 31, 2005 3:37 PM
To: Struts-user
Subject: Automatic validation question...
If I have set up validation as follows:
field property=myField depends=validwhen, required
arg0 key=myForm.FirstName
If I have set up validation as follows:
field property=myField depends=validwhen, required
arg0 key=myForm.FirstName/
var
var-nametest/var-name
var-value(radioButton = firstNameSearch)var-value
/var
/field
If validwhen failts, will it try to validate the
Hello,
I have extended the RequestProcessor and I am looking for a way to find out
where the page is going to. The reason for this is as follows. I am giving each
user a UserObject when they hit the site. Later on, after they log in, I set
some flags to know they are valid inside the
-
From: Scott Purcell
To: user@struts.apache.org
Subject: Request Processor validation Question
Date: Mon, 14 Mar 2005 09:31:35 -0600
Hello,
I have extended the RequestProcessor and I am looking for a way to
find out where the page is going to. The reason for this is as
follows. I am
List
Subject: Re: Request Processor validation Question
Hi Scott,
Check the javadocs for the RequestProcessor. Any method which has an
ActionMapping as an argument can be used to figure out the action (ex:
mapping.getPath()). If you plan to do authorization the method processRoles()
is a good
@struts.apache.org
Subject: RE: Request Processor validation Question
Date: Mon, 14 Mar 2005 10:18:34 -0600
If I use the processRoles(), does that mean I have to use the J2EE
authentication mechanism for web applications? Using the container
and declare the applications declaratively?
I am using
validation Question
Date: Mon, 14 Mar 2005 11:36:44 -0500
There is nothing special about processRoles(). It just returns true
by default.You can overide it and implement whatever logic you want
in it. It is not tied to any J2ee mechanism.
- Original Message -
From: Scott Purcell
Is it possible to pass the incorrect field value that was entered by the
user
to the error message such that
errors.email={0} is an invalid e-mail address.
gets generated as
someIncorrectEmailAddr is an invalid e-mail address
Thanks in advance.
I am having From date - in the form of 3 separate lists for - Day, Month, Year.
Similarly i have To date.
Using struts validator framework,
1)Firstly i want to validate whether the combined entries (day, month, year) is
a valid date or not
2)Secondly whether first date to date
I tried to
Thanks for your help Eddie! Regex worked perfect.
I had given up hope on getting right regex.
Thanks Again!
- Original Message -
From: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, December 20, 2004 12:12 AM
Subject: Re: Struts Form Validation
:12 AM
Subject: Re: Struts Form Validation Question
^([a-zA-Z]+['-\s])*$
That's top of my head ... and my head is tired :-( but maybe it's
helpful. You need to separate the repeating things from the
non-repeating things, and allow the two of them to be chained multiple
times. Having
]
Subject: Struts Form Validation Question
Date: Sun, 19 Dec 2004 23:36:48 -0500
Hi,
I am using struts validator plugin. I have form field which requires
following validation:
Full Name can contain only letters, dashes (-), apsotrophes(') and
single spaces
Here is the regex I am using
Follows
From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Struts Form Validation Question
Date: Sun, 19 Dec 2004 23:36:48 -0500
Hi,
I am using struts validator plugin. I have form field which requires
following validation:
Full
Hi,
I am using struts validator plugin. I have form field which requires
following validation:
Full Name can contain only letters, dashes (-), apsotrophes(') and
single spaces
Here is the regex I am using for this validation : ^[a-zA-Z'-\s]*$
The only problem with this regex is that it allows user
^([a-zA-Z]+['-\s])*$
That's top of my head ... and my head is tired :-( but maybe it's
helpful. You need to separate the repeating things from the
non-repeating things, and allow the two of them to be chained multiple
times. Having such complete validation of a name seems error-prone at
best
, httpServletRequest);
}
}
- Original Message -
From: Joe Hertz [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 11:43 AM
Subject: RE: validation question
Joe, do u mean checking the field with validwhen using
Hi,
Struts doesn't have anything like that.
IMHO, I also think that using validator on the login page is not good
practice as it would give malicious users a good idea on how your app
handles authentication.
Usually, you'd just return a generic error message such as
Username/password invalid
The validation works fine however, when I just type the
http://localhost:8080/login.do
in my browser (no submit), the validation error will show up at once.
I understand that it's just like I submit a form to login.do action
without any
parameter. My question is, do struts provide any simple
805 CSPTS/SCE [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 1:23 AM
Subject: RE: validation question
The validation works fine however, when I just type the
http://localhost:8080/login.do
in my browser (no submit), the validation error
At 10:28 AM +0800 10/19/04, Justy Wong wrote:
Thx for your suggestions.
1) 2 action mappings -- 1 with validation turned off (welcome.do) and 1
with it on (login.do).
that means for every action, I've to create 1 more action. but it will
almost double the maintainence affort.
In practice, it's
- Original Message -
From: Justy Wong [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 18, 2004 9:28 PM
Subject: Re: validation question
Thx for your suggestions.
1) 2 action mappings -- 1 with validation turned off (welcome.do) and 1
Nice trick, Joe - hadn't thought of doing that :-)
- Original Message -
From: Joe Germuska [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 18, 2004 9:40 PM
Subject: Re: validation question
At 10:28 AM +0800 10/19/04, Justy Wong wrote:
Thx for your
: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 10:53 AM
Subject: Re: validation question
Nice trick, Joe - hadn't thought of doing that :-)
- Original Message -
From: Joe Germuska [EMAIL PROTECTED]
To: Struts Users Mailing
Joe, do u mean checking the field with validwhen using
validation.xml or
implement the actionForm.validate() ?
I really want to use the basic struts validation framework instead of
implementing validate() function to minimize the maintainence cost.
You can do it both ways.
Use
, httpServletRequest);
}
}
- Original Message -
From: Joe Hertz [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 11:43 AM
Subject: RE: validation question
Joe, do u mean checking the field with validwhen using
validation.xml or
implement
Had the same problem
Solution:
...
var-value![CDATA[^]]/var-value
...
kris
-Oorspronkelijk bericht-
Van: Eric Dahnke [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 18 mei 2004 20:24
Aan: Struts Users Mailing List
Onderwerp: Validation question. Disallow characters using regex mask
Hi All,
i'm trying to set up automatic validation (required validator), everything is working,
except the key lookup in the message resources. Every time i submit my form i get a
'null is required' instead of the textfield label.
I double-checked the settings about a thousand times, searched
68 matches
Mail list logo