JAVA中,默认的编码方式是unicode,所以你在输出到页面之前应把所有字符串的编码格式转换,使用下面的函数:
public String transCode(String chi){
  String result=null;
  byte[] temp;
  try{
  temp=chi.getBytes("iso-8859-1");
  result=new String(temp);
  }
  catch(UnsupportedEncodingException e){
  return null;
  }
  return result;
 }