[EMAIL PROTECTED] wrote:
Can anyone tell me how to do conditional validation in struts 2?
In one form I want validations for a particular category (say Category XYZ) only if
the candidate in that. If he is NOT Category XYZ then by checking a checkbox he
should be able to skip the validations f
I added this as
* http://jira.opensymphony.com/browse/XW-565
-Ted.
On 8/3/07, mraible <[EMAIL PROTECTED]> wrote:
>
> I figured out how to do this - posting here so others will benefit.
-
To unsubscribe, e-mail: [EMAIL PROTECTE
I'm pretty sure you need to have around
your expression.
Z.
>
> Perhaps someone can order this XML to produce the desired result?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> model.password.equals(model.confirmPassword)
>
>
> ${getText("nomatch")} ${model.password} and
> ${model.confirmPas
--- stanlick <[EMAIL PROTECTED]> wrote:
>
> model.password.equals(model.confirmPassword)
>
> ${getText("nomatch")} ${model.password} and
> ${model.confirmPassword}
>
>
I wouldn't even think that would pass DTD validation;
doesn't the expression need to be in a param tag?
d.
--
Perhaps someone can order this XML to produce the desired result?
model.password.equals(mod
Can you paste the entry from validator xml -- and the line which is
flagged with the error?
>From the error message, it just looks like an ordering problem -- ie
we must have param tag before the message tag ; but i may be
oversimplifying things..
On 8/18/07, stanlick <[EMAIL PROTECTED]> wrote
Matt --
Did you have trouble getting your validation entries to pass the dtd rules?
I'm using "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"; and
getting the error The content of element type "field-validator" must match
"(param*,message)".
mraible wrote:
>
> I figured out ho
I'm still wondering how to do a pure flag check alone using validators
- i.ei need to check a guard expression before firing actual
validations on the
field ; and if the guard expression fails - the validations must simply be
skipped (as if the field didn't exist) and move on to next page - without
I haven't tried working with Struts 2's annotations for validation yet, so
I'm unable to answer this question. In a week, things might be different.
;-)
Matt
strutstwouser wrote:
>
> Hi Matt,
>
> Can you please tell me what's needed to use this validator using
> annotations alone? . Also, i
Hi Matt,
Can you please tell me what's needed to use this validator using annotations
alone? . Also, i need a simple conditional validator - ie a field needs to
be validated only if a prerequisite condition is satisfied, else the
validations on it must be skipped and no error must be added (sinc
I figured out how to do this - posting here so others will benefit.
1. Create a new ConditionalVisitorFieldValidator.java:
public class ConditionalVisitorFieldValidator extends VisitorFieldValidator
{
private String expression;
public void setExpression(String expression)
{
this.expre
I need to do something similar - is it possible to have conditional visitor
validation in Struts 2? AFAICT, it isn't.
Basically, I'd like to have a couple of validation rules for a drop-down.
One rule is that the user must select at least one choice when the drop-down
has its radio button selecte
--- "Peter L. Berghold" <[EMAIL PROTECTED]> wrote:
> Consider the following sniglet from my
> validation.xml:
>
> depends="requiredif">
>
>
> field[0]
> dropins_allowed_rq
>
>
> fieldTest[0]
> EQUALS
>
>
> fieldValue[0]
> on
>
>
What version of Struts are you using? IIRC requiredif
was d
Can you override the validate() method in your form that extends ValidatorForm,
and then inside that do something like this?
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
{
ActionErrors errors = null;
if ( request.getParameter("closeButton") == null ) {
If you do not use client-side validation (I never do), you can do this:
Override getValidationKey() in your ActionForm and come up with a different key
that the validator should use. You might want to look for a certain request
parameter (like the close button) and either totally ignore validati
Dave Newton on 04/05/06 19:13, wrote:
Adam Hardy wrote:
In the last couple of days someone said that they separated the two
flows using GET and POST - or at least I thought so.
It sounded interesting but on looking at the struts-config DTD, there
seems no way to do this.
I can't find the threa
Adam Hardy wrote:
> In the last couple of days someone said that they separated the two
> flows using GET and POST - or at least I thought so.
>
> It sounded interesting but on looking at the struts-config DTD, there
> seems no way to do this.
>
> I can't find the thread in the archive now. Did I m
On May 4, 2006, at 11:27 AM, Adam Hardy wrote:
> In the last couple of days someone said that they separated the two
> flows using GET and POST - or at least I thought so.
>
> It sounded interesting but on looking at the struts-config DTD,
> there seems no way to do this.
>
> I can't find the thr
Hi
Can you point it where i can find it
Thanks
2006/5/4, James Mitchell <[EMAIL PROTECTED]>:
The newest version of the Struts mailreader sample app shows a best
practices approach to just what you describe.
Take a look at that and see if you might be able to do the same.
(Specifically, look at
Could be easily overlooked, I agree - but is it even possible? I don't
think it is possible to configure on the action mapping level.
James Mitchell on 04/05/06 17:43, wrote:
I don't think that would be the best solution (but that's just my 2c) --
I would opt for the declarative approach, with
I don't think that would be the best solution (but that's just my 2c)
-- I would opt for the declarative approach, with wildcards for
"verbosely declarative simplicity" -- now there's an oxymoron for ya :)
--
James Mitchell
On May 4, 2006, at 11:27 AM, Adam Hardy wrote:
In the last coupl
In the last couple of days someone said that they separated the two
flows using GET and POST - or at least I thought so.
It sounded interesting but on looking at the struts-config DTD, there
seems no way to do this.
I can't find the thread in the archive now. Did I misread that previous
post
The newest version of the Struts mailreader sample app shows a best
practices approach to just what you describe.
Take a look at that and see if you might be able to do the same.
(Specifically, look at the paths for Edit* and Save*)
HTH
--
James Mitchell
On May 4, 2006, at 9:40 AM, Mu
Sent: Sunday, November 27, 2005 1:32 PM
Subject: Re: conditional validation
Thanks Martin for responding. But I am afraid we probably are talking of two
different things. Unless I am missing some point somewhere. I am referring
to regular expressions in the context of validator framework. (entrie
> Taglib?
>
> http://struts.apache.org/struts-doc-1.2.7/userGuide/struts-logic.html#lessEqual
> HTH,
> M-
> - Original Message -
> From: "Raghu Kanchustambham" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> Sent: Sunday, November 27, 2005 3:
s Mailing List"
Sent: Sunday, November 27, 2005 3:43 AM
Subject: Re: conditional validation
> ...(educationDetails[0].marks le 100)...
Doesnt work... le/ge/gt/lt is not recognized.
I worked around the problem by enforcing through floatRange to be between 35
and 100. Note that floatRange valid
> ...(educationDetails[0].marks le 100)...
Doesnt work... le/ge/gt/lt is not recognized.
I worked around the problem by enforcing through floatRange to be between 35
and 100. Note that floatRange validations work perfectly fine. I wanted to
allow either a "0" (to stand for a 'dont care') and a ra
Raghu Kanchustambham wrote:
Second, shouldn't you allow an empty value for marks if degree.id isn't
set,
rather than forcing the user to enter numeric data that's going to be
ignored?
I really dont care about what the user enters for marks if he chooses "none"
for the degree. I dont care even
newton rutgers wrote:
Hello All,
Can i do the conditional validation. For example if i have a drop down
and the default value is "Please select one". if user dosen't select
anything. validation won't show that it is required field to select.
can anyone please help. Also how do i validation for
Hi Laurie,
Thanks for responding.
> Firstly, the check for marks <= 100 in the validwhen rule is redundant,
True! I realize that and have removed that.
> Second, shouldn't you allow an empty value for marks if degree.id isn't
set,
> rather than forcing the user to enter numeric data that's going
Raghu Kanchustambham wrote:
Hi,
I have the following situation:
1. educationDetails[0].degree.id is not chosen. (drop down return value =
-1).
OR
2. educationDetails[0].degree.id > 0 (the user chose one of the options from
the drop down) which implies the marks should be atleast 35% and not mo
Jay Burgess wrote:
I have a form field on my JSP that's being conditionally displayed based on the
status of servlet context attribute:
I'm using the Struts validator to validate this field:
...
Obviously, I only want the client-side Javascript validations to fire if the
field is pre
Saul Qunming Yuan dataanvil.com> writes:
>
> That's simlar to what I need, except that it's not an indexd property. Can
> some of your code or send it to me offline.
>
> thanks,
> Saul
>
> > On my current project I've written a validation method that
> > dynamically invokes other validation ru
That's simlar to what I need, except that it's not an indexd property. Can
some of your code or send it to me offline.
thanks,
Saul
> On my current project I've written a validation method that
> dynamically invokes other validation rules depending on the String
> returned by bean.getDepends()
>
On my current project I've written a validation method that
dynamically invokes other validation rules depending on the String
returned by bean.getDepends()
It's used with indexed properties where the fields for the form to
fill in are configurable and come from a database.
Is that what you're af
Upon further reading (sorry for the lack of rtfm), I discovered requiredif.
Erik
Erik Weber wrote:
Greetings. I am using the Validator plugin with Struts ValidatorForm
subclasses.
In one form, I have a boolean select (the labels are "Yes" and "No",
the values are "true" and "false"). There is a
36 matches
Mail list logo