Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Struts validator fails to validate locale-sensitive double values

Posted on 2009-07-08
1
Medium Priority
?
374 Views
Last Modified: 2013-11-24
Looking for a way to use the Struts Validator to correctly validate user-entered double values, (which are really currency values), in a locale-sensitive way. Is this even possible? I have a form that is localized which allows users to enter a monetary amount. I want the Struts Validator to validate whether it is a valid value. Below is a snippet of my validation.xml file. If a user enters a value of 5.000,00 then the validation fails even though this is a valid amount in Greece for example.

I have set the user session locale appropriately, el_GR, prior to the call to validate.
<form name="myForm">
       	<field property="loanAmount" depends="required,double,doubleRange">
		<arg0 key="my.loanAmount"/>
		<var>
			<var-name>min</var-name>
			<var-value>0</var-value>
		</var>
		<var>
			<var-name>max</var-name>
			<var-value>999999</var-value>
		</var>
	</field>
</form>

Open in new window

0
Comment
Question by:brian-barnett
1 Comment
 

Accepted Solution

by:
brian-barnett earned 0 total points
ID: 24863060
Not sure what to add here to make it more understandable. I thought it was a thorough description. In the absence of response and being unable to find a solution myself, I opted to do the validation myself, outside of the validation provided by Struts validator. Darn :(
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question