my j2ee app works was developed in eclipse elios with tomcat 7 as application server. My workstation has windows 7. In a jsp i have an input text for sending mail to several user. In windows, the character like è works fine, i receive the mail and i see the è; when i deploy the war on tomcat on linux centOS, i don't see the è, but a strange character. this is the function that send email:
public boolean inviaMail() throws Exception{
boolean invio=true;
try {
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", HOST);
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setHeader("Content-Type", "text/html; charset=UTF-8");
message.setFrom(new InternetAddress(MITTENTE));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(userTo));
message.setSubject(OGGETTO, "UTF-8");
message.setText(testoMsg, "UTF-8");
Transport.send(message);
} catch (Exception e) {
invio=false;
System.out.println("errore.invio.mail:" + e.getMessage());
}
return invio;
}
i think the problem is the tomcat configuration on linux, do you have some tips for me?