前提
フォーム入力欄に入力した数値を変換しないで取得したい
実現したいこと
入力値の全角半角チェックを行う関係上、
java側でデータ型をBigDecimalで定義している入力欄の値に全角数字が入力された際に変換をしないようにしたいです。
該当のソースコード
springboot
1public class TestEntity { 2 3 4 @NotNull 5 private BigDecimal Price; 6
html
1<!DOCTYPE html> 2<html xmlns:th="http://www.thymeleaf.org"> 3<head> 4<meta charset="UTF-8"> 5<title>Insert title here</title> 6</head> 7<body> 8 9<!-- objectにフォームオブジェクトを、fieldにはそれに対応するオブジェクトのフィールドを記載する。 --> 10 <form method="post" action="/user/signup" th:object="${testEntity}"> 11 <input type="text" value="*{Price}" 12 <input type="submit" value="registration"> 13 </form> 14</body> 15</html>
試したこと
BigDecimalのリファレンス等調べましたが、入力値そのものを取得する方法まで辿り着けませんでした。
![guest](/img/icon/icnUserSample.jpg)
回答1件
あなたの回答
tips
プレビュー