Solved

Struts validator fails to validate locale-sensitive double values

Posted on 2009-07-08
1
372 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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 …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

623 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