Re: Req on

2006-05-23 Thread The Jasper

Hi,

I'm not quite sure how you'd do it, but it seems like you could use
logic tags to do this.
something like:


Hi

  Javascript...the right way

  one change of the one select combo box call some function which will fill up 
the othercombo box.

  U can search on google for such code.

  regards
  Novin

"Miller, Andy" <[EMAIL PROTECTED]> wrote:
  Javascript...

Andy Miller
IS Designer
Butte College
530.895.2946
-Original Message-
From: Radha Krishna [mailto:[EMAIL PROTECTED]
Sent: Monday, May 22, 2006 7:56 AM
To: user@struts.apache.org
Subject: Req on

Hi All,

I have one simple question.

i have two controls in same form.

when we select one control,then other one should get populated without
calling the Action

ie the options in the second control depends on the selected value of
first control.

please tell me the best way to handle this one.

thanks in advance

__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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




Thanks and Regards,
Novin Jaiswal
+919890089443(M)
+912039511388(H)
+912026901306(O) direct
+912026982424 Extn:1306

-
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates 
starting at 1¢/min.



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



Re: Harsh: Issue with float validation instruts validator

2006-05-24 Thread The Jasper

Near as I can tell a float s evaluated as Float(value). So, looking in
the java specs we see that a float needs a 'decimal point, an
exponent, or a float type suffix '. see
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#230798
for more information. As for the validwhen, that should either do an
integer comaprison or a string comparison. I would guess that somehow
it fails to recognize 0.0 as an int and does a string compare. Then
0.0 really is > 0. either compare against 0.0 and ignore all int
values as not being floats, or write a custom validator, or wait for
someone smarter than me to give you a usefull answer ;}

mvg,
Jasper

On 5/23/06, Chaudhary, Harsh <[EMAIL PROTECTED]> wrote:

I have a field which is being validated as:

  


  test
  
( *this* > 0 )
  

  

Well the validwhen has a bunch of other conditions. I just left them out
for clarity.

Anyways, this field is a float and its valid when its value is greater
than 0. This works perfectly when I enter a 0 in the field i.e. I get an
error. But if I type in 0.0, it validates fine. Not only that, if I type
in .1 in the field, I get an error whereas this should be a valid value.
But 0.1 works fine. I can only think this is a bug in the validation.

Has anyone else noticed this issue? Any ideas or workarounds?

Harsh.

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




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



Re: Validation for second field must greater than the first field

2006-05-26 Thread The Jasper

Hi,

I just happened to be working on this problem myself. I wrote a validator:

public class dateValidation implements Serializable {

   private static final Log log = LogFactory.getLog(dateValidation.class);


/* checks two date fields to see if the second field isn't earlier than
 * the first field.
 * Use in combination with Date validator to make sure date format is 
correct.
 */ 
   public static boolean beginEndDate(Object bean,
   ValidatorAction va, Field field,
   ActionMessages errors,
   Validator validator,
   HttpServletRequest request){

Date beginDate = null;
Date endDate   = null;

   String dateBegin   = ValidatorUtils.getValueAsString(bean,
field.getProperty());
   String sProperty2  = field.getVarValue("endDate");
   String dateEnd = ValidatorUtils.getValueAsString(bean, sProperty2);
   String datePattern = field.getVarValue("datePattern");

   SimpleDateFormat sdf = new SimpleDateFormat(datePattern);

   try{
beginDate = sdf.parse(dateBegin);
endDate   = sdf.parse(dateEnd);
   }
   catch (ParseException e){

if (log.isDebugEnabled()) {
   log.debug("Date parse failed dateBegin =[" + dateBegin
+ "] dateEnd =["+ dateEnd + "], " +
 "pattern=[" + datePattern +
"], " + e);
   }
   }

   if (beginDate.compareTo(endDate) <= 0) return true;

return false;
   }

}

you'll also need to add the following to validation-rules:




I haven't tested it yet, so I give no guarantees.

mvg,
Jasper


On 5/25/06, Chaudhary, Harsh <[EMAIL PROTECTED]> wrote:

Yeah. There is this date comparator at:
http://jakarta.apache.org/commons/validator/apidocs/org/apache/commons/validator/routines/DateValidator.html

It has methods like compareDates etc. But you will need to call this method 
from a Java class and a custom validator seems like a good place. Considering 
it gives you access to a bunch of objects for free like the form bean, fields, 
the request object, errors object etc. You could probably do it in a separate 
class cueing off of the data from the form bean, but I think it would be much 
harder.


Harsh.

-Original Message-
From: Carl Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 25, 2006 2:31 PM
To: Struts Users Mailing List
Subject: RE: Validation for second field must greater than the first field


Harsh, Thanks for the quick response.

  I was seeking if  Struts has the internal validator do this things. If not, 
then I agree with you in that I need to write my own custom validator easily. 
But I prefer if Struts already has this sort of comparison validator.


"Chaudhary, Harsh" <[EMAIL PROTECTED]> wrote:
  The solution is to write a custom validator if you want to do it server side using validator. In 
your custom validator, create 2 calendars, one each for start date and end date. Then use the 
method call "before" or "after" on these calendar.

Harsh. Man I got a lot of free time today.

-Original Message-
From: Carl Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 25, 2006 2:20 PM
To: Struts Users Mailing List
Subject: Validation for second field must greater than the first field


I am not sure if this is workable, but my requirement was that

Two Fields, startDate and endDate, I need to validate the endDate is 
greater/older than the startDate. Is this something workable/configurable using 
struts validator?

Thanks.


-
Ring'em or ping'em. Make PC-to-phone calls as low as 1¢/min with Yahoo! 
Messenger with Voice.

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




-
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.

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




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



Re: Validation for second field must greater than the first field

2006-05-26 Thread The Jasper

Of course my code *doesn't* work, but I'll leave the reason why as an
exercise for the reader ;}

mvg,
Jasper

On 5/26/06, The Jasper <[EMAIL PROTECTED]> wrote:

Hi,

I just happened to be working on this problem myself. I wrote a validator:

public class dateValidation implements Serializable {

private static final Log log = LogFactory.getLog(dateValidation.class);


/* checks two date fields to see if the second field isn't earlier than
 * the first field.
 * Use in combination with Date validator to make sure date format is 
correct.
 */
public static boolean beginEndDate(Object bean,
ValidatorAction va, Field field,
ActionMessages errors,
Validator validator,
HttpServletRequest request){

Date beginDate = null;
Date endDate   = null;

String dateBegin   = ValidatorUtils.getValueAsString(bean,
field.getProperty());
String sProperty2  = field.getVarValue("endDate");
String dateEnd = ValidatorUtils.getValueAsString(bean, sProperty2);
String datePattern = field.getVarValue("datePattern");

SimpleDateFormat sdf = new SimpleDateFormat(datePattern);

try{
beginDate = sdf.parse(dateBegin);
endDate   = sdf.parse(dateEnd);
}
catch (ParseException e){

if (log.isDebugEnabled()) {
log.debug("Date parse failed dateBegin =[" + dateBegin
+ "] dateEnd =["+ dateEnd + "], " +
  "pattern=[" + datePattern +
"], " + e);
}
}

if (beginDate.compareTo(endDate) <= 0) return true;

return false;
}

}

you'll also need to add the following to validation-rules:

 


I haven't tested it yet, so I give no guarantees.

mvg,
Jasper


On 5/25/06, Chaudhary, Harsh <[EMAIL PROTECTED]> wrote:
> Yeah. There is this date comparator at:
> 
http://jakarta.apache.org/commons/validator/apidocs/org/apache/commons/validator/routines/DateValidator.html
>
> It has methods like compareDates etc. But you will need to call this method 
from a Java class and a custom validator seems like a good place. Considering it 
gives you access to a bunch of objects for free like the form bean, fields, the 
request object, errors object etc. You could probably do it in a separate class 
cueing off of the data from the form bean, but I think it would be much harder.
>
>
> Harsh.
>
> -Original Message-
> From: Carl Smith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 25, 2006 2:31 PM
> To: Struts Users Mailing List
> Subject: RE: Validation for second field must greater than the first field
>
>
> Harsh, Thanks for the quick response.
>
>   I was seeking if  Struts has the internal validator do this things. If not, 
then I agree with you in that I need to write my own custom validator easily. But 
I prefer if Struts already has this sort of comparison validator.
>
>
> "Chaudhary, Harsh" <[EMAIL PROTECTED]> wrote:
>   The solution is to write a custom validator if you want to do it server side using validator. 
In your custom validator, create 2 calendars, one each for start date and end date. Then use the 
method call "before" or "after" on these calendar.
>
> Harsh. Man I got a lot of free time today.
>
> -Original Message-
> From: Carl Smith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 25, 2006 2:20 PM
> To: Struts Users Mailing List
> Subject: Validation for second field must greater than the first field
>
>
> I am not sure if this is workable, but my requirement was that
>
> Two Fields, startDate and endDate, I need to validate the endDate is 
greater/older than the startDate. Is this something workable/configurable using 
struts validator?
>
> Thanks.
>
>
> -
> Ring'em or ping'em. Make PC-to-phone calls as low as 1¢/min with Yahoo! 
Messenger with Voice.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> Do you Yahoo!?
>  Get on board. You're invited to try the new Yahoo! Mail Beta.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: validation with validwhen

2006-05-26 Thread The Jasper

Hi,

from http://struts.apache.org/struts-doc-1.2.9/userGuide/dev_validator.html
we learn that:

If both items to be compared are convertable to ints, a numeric
comparison is done, otherwise a string comparison is done.

so since about any string is >= you will almost always get a valid check.

I think you want to use the doubleRange validator on the range 0.0 -
Double.MAX_VALUE (allthough I don't know if you can say that in
validation.xml, other wise just choose an unbelievably high number).

Or else, do what your are doing, but add a double validator (which you
need for doubleRange anyway). That is probably a slightly better
solution, but I don't know what happens with input like 1.2234534534.
Is it an int or a string?

mvg,
Jasper

On 5/26/06, fea jabi <[EMAIL PROTECTED]> wrote:

can someone help me with this please? thanks.


>From: "fea jabi" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" 
>To: user@struts.apache.org
>Subject: validation with validwhen
>Date: Thu, 25 May 2006 12:31:56 -0400
>
>want to validate a property for
>
>required,
>and also make sure it's value is greater than Zero. The value should be a
>positive double.
>
>tried the below
>
>
>
>
>test
>(*this* >= 0)
>
>
>
>when nothing is entered by the user, getting the required message. When
>entered the characters not getting the message of validwhen.
>
>what am I missing?
>
>Thanks.
>
>_
>Don't just search. Find. Check out the new MSN Search!
>http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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




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



Re: How to lock the access of methods within an action?

2006-05-30 Thread The Jasper

Hi,

this sounds like a common database problem. You might want to consider
some kind of pessimistic locking. Basically you lock the object when
you start editing and prevent all access to it for the duration of the
lock. You could also do an optimistic lock which means that when you
change an object it will only be committed if the object hasn't
changed between the time you got your lock and the time you want to
commit it. This doens't prevent you from having done unnecessary work
however. Most db's support optimistic locking, but not pessimistic
locking.

If you want to use this at the application level you will have to do
it yourself. You could put a variable somewhere to track wether an
object is being edited and base access restrictions off of that.
However you have to be very carefull about making sure you don't get
any deadlock or race conditions.

I suggest you delve into database world and read about how other
people have solved this problem.

mvg,
Jasper

On 5/30/06, Julian Tillmann <[EMAIL PROTECTED]> wrote:

Hello everyone,



Within our struts web application in which we have edit-actions within a user 
can be busy editing data in the form for several minutes.

The problem is, if another user is also editing the data at the same time, one of the is 
eventually going to overwrite the changes of the other and the other will have worked 
completely in vain. So my question would be whether there's some way to prevent this from 
happening, some kind of "lock down" method for edit-actions? I think this 
problem is not uncommon, can someone give me a tip?



thanks in advance
Julian

--


Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
  Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer


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




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



Re: Help:validation is not working with struts1.2

2006-05-30 Thread The Jasper

Hi,
try changing the validation to:

 

  

note, you are now referencing the action not the page.

Also, you might want to extend ValidatorActionForm instead of
ValidatorForm, but to tell the truth I'm not sure I really understand
the difference.

You don't need the key field if you ask me, but you might want a msg
field for custom messages.

good luck with it.

mvg,
Jasper

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



Re: Problem in a action

2006-06-07 Thread The Jasper

Validate requires an input attribute in order to know what page to
return to when validation fails.

mvg,
Jasper

On 6/7/06, José María Tristán <[EMAIL PROTECTED]> wrote:

Hi:

I have an error when i try launch an action of struts:

 No input attribute for mapping path
/coffeenet/SeguimientoComercial/IndexSeguiComer

The struts-config.xml:









The best of it is that this action has been working.

Thanks very much


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




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



Re: JSP error using struts 1.1

2006-06-08 Thread The Jasper

Hi,

I used to have this error as well. Its a warning from Eclipse, right?
If so, just ignore it.

mvg,
Jasper

On 6/7/06, Olivier Bex <[EMAIL PROTECTED]> wrote:

Hi everyone,



Using struts 1.1 with eclipse 3.1 and myeclipseIDE I have an error with a
JSP page :

"Failed to load or instantiate TagExtraInfo class :
org.apache.struts.taglib.bean.CookieTei. NOTE : No JSP line was available so
line 1 was used for the marker."



After searching through the Internet, I have no answer for that.



Regards,

Olivier BEX







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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread The Jasper

What isn't working? Is it not validating properly? Are you getting
some type of exception? Does it accept everything?

You can alway check the source code of FieldChecks to find out what it is doing.

mvg,
Jasper

On 6/8/06, antony.paul <[EMAIL PROTECTED]> wrote:


Hi all,
  I am trying to validate a field against 'double', In
validation.xml i have specified the validation logic as.
 
  
  
This is not working, but it will work fine If I change it to' depends
="integer" ' instead of "double".
In my validatior-rules.xml file I have written the rule as
FOR 'integer'
 
FOR 'double'
   < validator name="double"
classname="org.apache.struts.validator.FieldChecks"
   method="validateDouble"
 methodParams="java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest"
  depends=""
  msg="errors.double"
 jsFunctionName="DoubleValidations"/>

What I am really curious about is that when its working  fine for 'integer'
why not for 'double'

Thanks
Antony
--
View this message in context: 
http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4769223
Sent from the Struts - User forum at Nabble.com.


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




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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread The Jasper

hi,

It looks fine to me. It sort of sounds like validation is not
happening at all. Maybe  there is a problem in your form or jsp. Or
you coulld try updating to the latest version of Validator/struts if
yuo haven't allready.

mvg,
Jasper

On 6/8/06, antony.paul <[EMAIL PROTECTED]> wrote:


Hi
  Sorry for that incomplete mail. I am not getting any excetption and
that particular field is accepting everthing like characters and getting
saved in the database as '0', I guess thats the default value for that field
because I have defined that corresponding property in the Action Form as a
'Double'

Thanks
Antony
--
View this message in context: 
http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4769709
Sent from the Struts - User forum at Nabble.com.


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




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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread The Jasper

always pass the double validation (but fail integer validation :-) For
this to work you need to define the property in your ActionForm as a
String, not a Double.


oops, missed that :}

mvg,
Jasper

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



Re: check invalid date with validator framework

2006-06-12 Thread The Jasper

On 6/9/06, Shoukat, Faisal <[EMAIL PROTECTED]> wrote:

Is there a way to check if the date is a valid date in the validator
framework.  If I enter a invalid date such as 67/06/2006 it returns me the
error message Created Date is not a valid date format (dd/mm/).

Which is the error.date in my message resources.  However I want to not
check the format in this case but want it to check that the 67 is invalid?



Hi,

The date validator doesn't really make a difference between an invalid
date and an invalid format. It's the same. You can specify whether you
want a strict date format or not. Strict means it will only accept
dates as dd/mm/ so it wont accept 5/5/2006 but only 05/05/2006.
For the rest it pretty much uses java.util.Date to do the validation.

if the error message bothers you, write a new one. You can use the msg
property or just the errors.date for that.


mvg,
Jasper

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



Re: sessions

2006-06-12 Thread The Jasper

hi,

You could use a login filter. Have the filter check if they are logged
in via a session attribute. If the person is logged, then fine.
Otherwise redirect to the login page. On logging in you set the
session attribute. Now just set the web.xml so that everything has to
go through the login filter *except* the login page.

mvg,
Jasper

On 6/12/06, Abhimanyu Koul <[EMAIL PROTECTED]> wrote:

hi all!
i want to use session validation in my application. no user should be allowed 
to view any page without logging in. if any user say copies the action from the 
properties window into the address bar of the browser, he should be directed to 
the login page. no error message should be shown neither the user should be 
allowed to do some operations without logging in.

can we use some feature of requestprocessor for that. what are the various 
methods to achieve that.

regards
Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Dani Compound,
158, Vidyanagari Marg,
Kalina, Santacruz (East),
Mumbai - 400 098
Mobile : +91 9819510090




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



Re: sessions

2006-06-13 Thread The Jasper

hi,

I would suggest a filter. You won't have to tag each page that needs
to be in session.

mvg,
Jasper

On 6/13/06, Abhimanyu Koul <[EMAIL PROTECTED]> wrote:

hi all!
can anyone tell me which approach is better for session validation in a struts 
application
 creating a custom jsp tag and using it in jsp pages or using request 
processor/filters.

and why??


Regards,
Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Mobile : +91 9819510090




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



Re: Validation a specific element in an String []

2006-06-22 Thread The Jasper

Hi,

so you have 2 textboxes and one of them is required, which is what you
want to validate. The problem is that they have the same name, I
assume. The obvious solution in that case would be to give them
different names, but I'm not sure I understand the question.

mvg,
Jasper

On 6/21/06, lingan <[EMAIL PROTECTED]> wrote:


Hi
I have two text boxes with the same name .
Only one of them is a 'required' field.
how should i do this.

thanks.
--
View this message in context: 
http://www.nabble.com/Validation-a-specific-element-in-an-Stringt1824259.html#a4975395
Sent from the Struts - User forum at Nabble.com.


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




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



Re: how to validate when the form-property is of type="java.lang.String[]"

2006-06-22 Thread The Jasper

Hi,

So...how are you putting them on the form. I assume you some form of
iterative tag to put them on a form. There is probably a better
solution, but you could write a custom validator, or validate() method
to do what you want. I had to do this for a similar situation, but I
had at least 2 levels of arrays to traverse. I seem to remember
thinking I could solve it with just one level array to deal with. Also
the validation was a little complex.

mvg,
Jasper

On 6/22/06, lingan <[EMAIL PROTECTED]> wrote:


Hi,
I am trying to validate a field declared as String[] in the form bean.
I think you should have solved this earlier.
can u help me ??
thanks.
--
View this message in context: 
http://www.nabble.com/how-to-validate-when-the-form-property-is-of-type%3D%22java.lang.String--%22-t9.html#a4983501
Sent from the Struts - User forum at Nabble.com.


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




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



Re: Struts Validator: form value1 < form value2

2006-06-22 Thread The Jasper

hi,
the validwhen validator can do what you want.

mvg,
Jasper

On 6/22/06, Truong Xuan Tinh <[EMAIL PROTECTED]> wrote:

Hi there,
You can write a custom validator in Struts to do that, it's rather easy,
both client-side and server-side. Open the jar of commons-validator to
see some script for existed validation rule should help.
Regards.
Tinh
Jeremy Nix wrote:
> How can I use the Struts Validator to enforce the above rule?  Neither
> of the fields are required, but if both are given, they must adhere to
> the given rule.
>
>
>
> Thanks for any help,
>
>
>
> _
>
> Jeremy Nix
>
> Senior Application Developer
>
> Southwest Financial Services, Ltd.
>
> (513) 621-6699 x1158
>
>
>
>
>


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




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



Re: validating checkbox

2006-06-22 Thread The Jasper

hi,

have you tried the required validator?

mvg,
Jasper

On 6/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Dear all,
How can I validate atleast one checkbox should be selected b4 form
submited. I am using html:multibox.

regards,
Mansoor


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




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



Re: validating checkbox

2006-06-22 Thread The Jasper

hi,

I think I shoul've looked more closely at your question. There are 2
problems I see. One is you want to make sure at least one checkbox is
checked. This could be done with validwhen. The other is that checkbox
values are only sent if checked, otherwise they are null. I don't know
how you would combine this with html:multibox, but with multiple
checkbox fields you should be able to check that at least one is
selected. I haven't gone any deeper than that. Maybe a custom
validator would work better for you, but I think it can be done with
the standard validators.

mvg,
Jasper

On 6/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi jasper,
S I have tried with required validator. It s not working.

 regards,
Mansoor






-Original Message-
From: The Jasper [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 22, 2006 1:30 PM
To: Struts Users Mailing List
Subject: Re: validating checkbox

hi,

have you tried the required validator?

mvg,
Jasper

On 6/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Dear all,
> How can I validate atleast one checkbox should be selected b4 form
> submited. I am using html:multibox.
>
> regards,
> Mansoor
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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




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




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



Re: Struts Validator: form value1 < form value2

2006-06-22 Thread The Jasper

The struts validator guide says you can only join 2 values with and or
or. I'm guessing that means you either have to put in a lot more
parentheses or that you can't use and or or more than once. I would
first try parenthesizing everything.

mvg,
Jasper

On 6/22/06, Jeremy Nix <[EMAIL PROTECTED]> wrote:

I'm trying the following validation, and it is giving me a syntax error:
"line 1:87: expecting RPAREN, found 'and'".  Am I going about this
wrong?



  test
  

  




  test
  

  


_
Jeremy Nix
Senior Application Developer
Southwest Financial Services, Ltd.
(513) 621-6699 x1158
-Original Message-
From: Jakub Milkiewicz [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 22, 2006 4:01 AM
To: Struts Users Mailing List
Subject: Re: Struts Validator: form value1 < form value2

Yeah validwhen can do it. anyway these antlr expressions are not very
intuitive.
If You have a problem let me kow i will try to help

2006/6/22, The Jasper <[EMAIL PROTECTED]>:
>
> hi,
> the validwhen validator can do what you want.
>
> mvg,
> Jasper
>
> On 6/22/06, Truong Xuan Tinh <[EMAIL PROTECTED]>
wrote:
> > Hi there,
> > You can write a custom validator in Struts to do that, it's rather
easy,
> > both client-side and server-side. Open the jar of commons-validator
to
> > see some script for existed validation rule should help.
> > Regards.
> > Tinh
> > Jeremy Nix wrote:
> > > How can I use the Struts Validator to enforce the above rule?
Neither
> > > of the fields are required, but if both are given, they must
adhere to
> > > the given rule.
> > >
> > >
> > >
> > > Thanks for any help,
> > >
> > >
> > >
> > > _
> > >
> > > Jeremy Nix
> > >
> > > Senior Application Developer
> > >
> > > Southwest Financial Services, Ltd.
> > >
> > > (513) 621-6699 x1158
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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




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



Re: validating checkbox

2006-06-22 Thread The Jasper

On 6/22/06, Scott Van Wart <[EMAIL PROTECTED]> wrote:


With multibox, all the checkboxes have the same name:

 A
 B

So if none are checked, the property in the ActionForm will be
String[0].  If there's a way of checking array lengths in the validwhen
validator, that's all he should need, but I don't know, as I've never
done it myself.


You can do something with IndexedListProperty, but I'm not sure how
you would use that here.  You can also use individual checkbox fields
with diffrent name, but that sounds messy.

the html:multibox definition says:

In order to correctly recognize cases where none of the associated
checkboxes are selected, the ActionForm bean associated with this form
must include a statement setting the corresponding array to zero
length in the reset() method.

This seems to imply that you can probably check if it is null.

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



Re: How to call a method from struts tag

2006-06-23 Thread The Jasper

hi,

depending on what you are checking, wouldn't some form of logic tag suffice?

mvg,
Jasper

On 6/23/06, Lance Semmens <[EMAIL PROTECTED]> wrote:

Can you do this in you action then have an isEnabled() method on your
component?

Pankaj Gupta wrote:
> Hi All,
>
> I want to call a method of an object in session scope that would check
> whether the component I wish to display on my JSP should be enabled or
> disabled. Can you please suggest how I can do that without using java
> scriptlets in my JSP.
>
> regards,
> Pankaj
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com



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




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



Re: Date Validation on the Clients side

2006-06-26 Thread The Jasper

Hi,

shot in the dark here, but have you tried datePatternStrict instead of
datePattern?

mvg,
Jasper

On 6/26/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:

Hello All,

I posted today the message below, unfortunately without any success. May be can somebody 
tell me if it is at all possible to validate date values like  "dd.MM. 
HH:mm" on the clients side. I really appreciate your help, it is really urgent.

Best regards,
Halgurt

-Ursprüngliche Nachricht-
Von: Halgurt Mustafa Ali
Gesendet: Montag, 26. Juni 2006 13:04
An: user@struts.apache.org
Betreff: Date Validation like "dd.MM. HH:mm"


Hello all,

Well I am trying to validate a field on the clients side. The field schould be validatet as a date in this 
format: "dd.MM. HH:mm" but I saw that the time would not be considerd, although I initialize 
datePattern in validation.xml with this value "dd.MM. HH:mm", the date will be validated 
against "dd.MM.". below is my formset in validation.xml:





datePatterndd.MM. 
HH:mm



datePatterndd.MM. 
HH:mm




I had a look at the validateDate.js in commons-validator.jar and I think it 
would not do that, what I want. Has anybody an Idea what am I doing wront, or 
do I have to do different.

Thank you in advance for your help,
Halgurt

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




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



Re: Date Validation on the Clients side

2006-06-26 Thread The Jasper

hi,

Looking at the js, I agree that this won't work, but that's only
client side. Server side validation should work, because that makes
use of SimpleDateFormat. So unless your pattern is being cut off
somewhere I would expect that to do the trick. For client side you
probably will have to write the js code to check for minutes and
seconds.

mvg,
Jasper

On 6/26/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:

Hi,

Yes I tried it, but no success.. I am using Struts 1.2.9 and 
commons-validator.jar 1.3.0 I had a look at validateDate.js and it seems for me 
not to be correct, it seems so, but whether or not, I am not sure.

mvg,
Halgurt
PS:I appreciate your help, many thanks:-)

-Ursprüngliche Nachricht-
Von: The Jasper [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 26. Juni 2006 17:11
An: Struts Users Mailing List
Betreff: Re: Date Validation on the Clients side


Hi,

shot in the dark here, but have you tried datePatternStrict instead of
datePattern?

mvg,
Jasper

On 6/26/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> I posted today the message below, unfortunately without any success. May be can 
somebody tell me if it is at all possible to validate date values like  "dd.MM. 
HH:mm" on the clients side. I really appreciate your help, it is really urgent.
>
> Best regards,
> Halgurt
>
> -Ursprüngliche Nachricht-
> Von: Halgurt Mustafa Ali
> Gesendet: Montag, 26. Juni 2006 13:04
> An: user@struts.apache.org
> Betreff: Date Validation like "dd.MM. HH:mm"
>
>
> Hello all,
>
> Well I am trying to validate a field on the clients side. The field schould be validatet as a date in this 
format: "dd.MM. HH:mm" but I saw that the time would not be considerd, although I initialize 
datePattern in validation.xml with this value "dd.MM. HH:mm", the date will be validated against 
"dd.MM.". below is my formset in validation.xml:
>
> 
> 
> 
> 
> datePatterndd.MM. 
HH:mm
> 
> 
> 
> datePatterndd.MM. 
HH:mm
> 
> 
> 
>
> I had a look at the validateDate.js in commons-validator.jar and I think it 
would not do that, what I want. Has anybody an Idea what am I doing wront, or do I 
have to do different.
>
> Thank you in advance for your help,
> Halgurt
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


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




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



Re: Validate just certain fields

2006-06-27 Thread The Jasper

HI,

You can write your own validate function or you can use the validation
framework. In any case no validation is performed on any field unless
you specify it. see
http://struts.apache.org/struts-action/faqs/validator.html for further
details.

mvg,
Jasper

On 6/26/06, Jennifer Jacobs <[EMAIL PROTECTED]> wrote:


I'm using the Struts Validator framework.

I have a form with two buttons on it, one that calculates a subtotal and one
that submits the form.  I have validation set to false, because I don't want
to validate the shipping address/email/phone number/etc when they calculate
the subtotal.  So, I do a form.validate() when the submit button is hit.

However, I DO want to validate the values they put in for quantity, etc.  I
know I can write validation for it all, but then my validation is in two
places - is there any way to "tell" it to validate JUST a certain set of
fields?

Thanks in advance,
Jennifer
--
View this message in context: 
http://www.nabble.com/Validate-just-certain-fields-t1850707.html#a5052596
Sent from the Struts - User forum at Nabble.com.


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




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



Re: Date Validation on the Clients side

2006-06-27 Thread The Jasper

HI,

Client side validation is usefull as you say (allthough you should
still always validate serverside as well). Unfortunately not all
things are given to us, so somethings we have to write for ourselves.
I think for most purposes date without time are sufficient, so that's
why it was done that way.

On 6/27/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:

Hi,

Ok, that means client side date validation is still not perfect. The point is, 
in a big application it is very usefull to have client side validation, even to 
unburden the server and have a better performance. Are you interessted in 
having such a validation on the clients side.

Best regards,
Halgurt

-Ursprüngliche Nachricht-----
Von: The Jasper [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 26. Juni 2006 17:50
An: Struts Users Mailing List
Betreff: Re: Date Validation on the Clients side


hi,

Looking at the js, I agree that this won't work, but that's only
client side. Server side validation should work, because that makes
use of SimpleDateFormat. So unless your pattern is being cut off
somewhere I would expect that to do the trick. For client side you
probably will have to write the js code to check for minutes and
seconds.

mvg,
Jasper

On 6/26/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Yes I tried it, but no success.. I am using Struts 1.2.9 and 
commons-validator.jar 1.3.0 I had a look at validateDate.js and it seems for me 
not to be correct, it seems so, but whether or not, I am not sure.
>
> mvg,
> Halgurt
> PS:I appreciate your help, many thanks:-)
>
> -Ursprüngliche Nachricht-
> Von: The Jasper [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 26. Juni 2006 17:11
> An: Struts Users Mailing List
> Betreff: Re: Date Validation on the Clients side
>
>
> Hi,
>
> shot in the dark here, but have you tried datePatternStrict instead of
> datePattern?
>
> mvg,
> Jasper
>
> On 6/26/06, Halgurt Mustafa Ali <[EMAIL PROTECTED]> wrote:
> > Hello All,
> >
> > I posted today the message below, unfortunately without any success. May be can 
somebody tell me if it is at all possible to validate date values like  "dd.MM. 
HH:mm" on the clients side. I really appreciate your help, it is really urgent.
> >
> > Best regards,
> > Halgurt
> >
> > -Ursprüngliche Nachricht-
> > Von: Halgurt Mustafa Ali
> > Gesendet: Montag, 26. Juni 2006 13:04
> > An: user@struts.apache.org
> > Betreff: Date Validation like "dd.MM. HH:mm"
> >
> >
> > Hello all,
> >
> > Well I am trying to validate a field on the clients side. The field schould be validatet as a date in 
this format: "dd.MM. HH:mm" but I saw that the time would not be considerd, although I initialize 
datePattern in validation.xml with this value "dd.MM. HH:mm", the date will be validated against 
"dd.MM.". below is my formset in validation.xml:
> >
> > 
> > 
> > 
> > 
> > datePatterndd.MM. 
HH:mm
> > 
> > 
> > 
> > datePatterndd.MM. 
HH:mm
> > 
> > 
> > 
> >
> > I had a look at the validateDate.js in commons-validator.jar and I think it 
would not do that, what I want. Has anybody an Idea what am I doing wront, or do I 
have to do different.
> >
> > Thank you in advance for your help,
> > Halgurt
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


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




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