日期:2014-05-18  浏览次数:20661 次

在servlet中取得值是乱码?
代码如下:
<form   action= "/DynaInforServlet "   method= "post ">
<input   type=submit   name= "mod "   value= " <bean:message   key= "dynaInfor.table.edit.update "   /> ">
<input   type=submit   name= "del "   value= <bean:message   key= "dynaInfor.table.edit.delete "   /> >
</form>
public   void   doPost(HttpServletRequest   request,   HttpServletResponse   response)throws   ServletException,   IOException   {

String   mod   =   request.getParameter( "mod ");
System.out.println(mod);
}
输出的是乱码!!!!
请问下,这怎么解决啊?

------解决方案--------------------
request.setCharacterEncoding( "GB2312 ");