I ran into a similar problem with the @ModelAttribute to fetch a model as parameter for my controller method. Then I hit upon a easy solution with help from chatgpt.
Just add this settings to your web.xml file.
If you want to pass unicode from jsp to java then:
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value> <!-- Set the desired character encoding -->
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern> <!-- Apply the filter to all URLs -->
</filter-mapping>
If you want to pass unicode characters from java to jsp:
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
The encodingFilter forcefully encodes the characters in UTF-8 (you can change it to any other encoding).
The jsp-config applies the page-encoding to all jsp pages opposed to specifying page-encoding in all pages individually. It helps jsp to render unicode charcters correctly.