I have an issue reading an XML string parameter from the request body.
Giving the following HTML:
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<body>
<form action="http://localhost:8080/action" method="post">
<input type="hidden" name="TEST" value="<test>mytest</test>"/>
<input type="submit" value="Submit">
</form>
</body>
</html>
And the following @PostMapping
action:
@PostMapping
public void action(HttpServletRequest request, HttpServletResponse response) throws Exception {
String context = request.getParameter("TEST");
System.out.println(context);
}
In the ouput console I have mytest
instead of <test>mytest</test>
The String is losing its Html entities.
What's missing?