I'm having problems with Turkish characters ... There are no problems on my JSP pages ... but when a warning appears on the Java side, the Turkish character (ŞşİığĞüÜç ...) looks like (Ä ±,?, ü, §, Å , ...)
In JSP pages I use this code, and ı can solve the Turkish character problem
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
in Spring MVC configuration, I tried a lot, but I didn’t succeed ... For example, in my mvc configuration class I set my MessageSource as follows:
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("classpath:messages");
messageSource.setUseCodeAsDefaultMessage(true);
messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(0);
return messageSource;
}
In this program, I try to enter a reset password, and I dialed an unregistered email address. Finally, I get an exception, and this is the following code for the blog code.
@Autowired
private MessageSource messages;
...
@ExceptionHandler({ UserNotFoundException.class })
public ResponseEntity<Object> handleUserNotFound(final RuntimeException exception, final WebRequest request) {
logger.error("404 Status Code", exception);
final GenericResponse bodyOfResponse = new GenericResponse(messages.getMessage("message.userNotFound", null, request.getLocale()), "UserNotFound");
return handleExceptionInternal(exception, bodyOfResponse, new HttpHeaders(), HttpStatus.NOT_FOUND, request);
}
In the messages_tr_TR.properties file
...
message.userNotFound=Kullanıcı Bulunamadı
...
but on JSP pages this warning is displayed like this:
KullanÄ ± cÄ ± BulunamadÄ ±
How can I solve this problem.