0

I am working on a project with spring boot web to serve a rest API (and using react.js on frontend) where embedded tomcat and dev-tools is used in development phase but is deployed to a jboss server via war file.

To keep consistency between dev mode and deployment mode, I am copying my front-end files to the classpath directory classpath:/public. This way of working is being very productive and I liked it.

The problem that is happening is that these front-end files have special characters (Portuguese characters) and only when I serve my application via WAR in jboss these characters are being displayed with problems. When I serve with embedded tomcat everything works fine.

Thanks in advance.

3
  • Did you double check that you are using UTF-8 in all your jboss configuration files? Commented Apr 20, 2017 at 20:08
  • I just checked my jboss files and two files were lacking enconding... but I fixed it and tried but no success... :( Commented Apr 20, 2017 at 20:27
  • What kind of Servlet have you configured to serve your static HTML/CSS/JS assets from your classpath? Commented Apr 21, 2017 at 3:27

1 Answer 1

0

Spring MVC defaults to ISO-8859-1, embedded Tomcat overrides it to UTF-8, see https://github.com/spring-projects/spring-boot/issues/1182

I fixed it with property spring.http.encoding.force=true

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.