Skip to content

Commit 254f58e

Browse files
committed
Triangle classifier SPA updated for text input converted Integer.parseInt
1 parent 1749495 commit 254f58e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jdk_21_maven/cs/web/triangle-ssr/src/main/java/com/example/springmvcdocker/FormController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public String showForm() {
1717

1818
@PostMapping("/process")
1919
public String processForm(
20-
@RequestParam("a") int a,
21-
@RequestParam("b") int b,
22-
@RequestParam("c") int c)
20+
@RequestParam("a") String a,
21+
@RequestParam("b") String b,
22+
@RequestParam("c") String c)
2323
{
24-
int value = TriangleClassification.classify(a, b, c);
24+
int value = TriangleClassification.classify(Integer.parseInt(a), Integer.parseInt(b), Integer.parseInt(c));
2525
String triangleType = getTriangleType(value);
2626
return "redirect:/" + triangleType.toLowerCase().replace(" ", "-");
2727
}

0 commit comments

Comments
 (0)