Error Handling - Redirect to error page in Vaadin Servlet

How to handle the following exception and redirect to custom error page in vaadin servlet

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Created custom bean also tried using configuring the properties but didn’t worked
server.tomcat.relaxed-path-chars
server.tomcat.relaxed-query-chars

Screenshot from 2024-08-01 20-40-10
Screenshot from 2024-08-01 20-40-02

Screenshot from 2024-08-01 20-39-07
Screenshot from 2024-08-01 20-37-45