首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2ME开发 >

Servlet读取wml参数中文乱码有关问题

2012-01-22 
Servlet读取wml参数中文乱码问题Servlet在读取参数时,如果参数是中文则不能正常显示,谁能帮一下吗,谢谢文

Servlet读取wml参数中文乱码问题
Servlet在读取参数时,如果参数是中文则不能正常显示,谁能帮一下吗,谢谢

文件index.wml
<?xml   version= "1.0 "?>
<!DOCTYPE   wml   PUBLIC   "-//WAPFORUM//DTD   WML   1.1//EN "   "http://www.wapforum.org/DTD/wml_1.1.xml ">
<wml>
<card   id= "index "   title= "test ">
<p>
<input   type= "text "   name= "name "/>
</p>
<do   type= "accept "   label= "test "   >
<go   href= "http://211.80.59.116:8080/encoding/Server "   method= "get ">
<postfield   name= "name "   value= "$(name) "/>
</go>
</do>
</card>
</wml>

Servlet文件
import   java.io.*;
import   javax.servlet.*;
import   javax.servlet.http.*;

public   class   Server   extends   HttpServlet
{
public   void   doGet(HttpServletRequest   req,HttpServletResponse   res)throws   IOException,ServletException
{
String   input=(String)req.getParameter( "name ");
System.out.println(input);
}
}


[解决办法]
中文问题每天都有新帖,都不知道搜索

热点排行