springMVC页面通过问号传值乱码问题解决

http://xph.iteye.com/blog/1570244


我的解决方法:写个转码的工具类,以便以后要用到的时候就可调用 

Java代码   收藏代码
  1. public class Tools {  
  2.     public static String enCodeStr(String str) {  
  3.         try {  
  4.           return new String(str.getBytes("iso-8859-1"), "UTF-8");  
  5.         } catch (UnsupportedEncodingException e) {  
  6.             e.printStackTrace();  
  7.             return null;  
  8.         }  
  9.     }  
  10. }  

你可能感兴趣的:(spring,mvc)