String tmpname=request.getParameter("name");
name = new String(tmpname.getBytes("ISO8859-1"),"gb2312");
你按我的转换就行了,记得给分哦
name = new String(tmpname.getBytes("ISO8859-1"),"gb2312");
你按我的转换就行了,记得给分哦
解决方案 »
- 菜单树
- if(!top.opener.closed)top.opener.location.reload();top.close();
- java序列化问题
- 在Ext下拉框中放一个grid 要怎么做才行呢?
- JS关闭页面提示
- 网站地址问题www.xxxx.com
- 用户登陆时输入错误的用户名出错,不知是怎么会事!!!
- 一个关于String的问题,我是菜鸟:(
- 谁有动态生成树的源码呀,给我发一份:[email protected],谢谢,最好有调用实例:)
- 在.war里,jsp无法访问servlet;急急急急急急急急
- 非法问题?
- 我用jstl中的Expression Language怎么显示不出来啊
如果你转GB2312不行的话。可以试一下,转GBK 将“流氓无赖”测试到底
——始于2003年7月
树欲止而风不停,行云流水匆匆去;
树梢蚂蚱凭空望,江边浪花碎巨石; 支持“流金岁月”!!!
发送框,少个“右键菜单,选择粘贴”;
——2003年12月24日am^@^
public class EncodeFilter extends HttpServlet implements Filter
{
private FilterConfig filterConfig;
protected String encoding = "GB2312"; public void init(FilterConfig filterConfig)
{
this.filterConfig = filterConfig;
} public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
{
try
{
if ((request.getCharacterEncoding() == null))
{
request.setCharacterEncoding(encoding);
}
filterChain.doFilter(request, response);
}
catch(ServletException sx)
{
filterConfig.getServletContext().log(sx.getMessage());
}
catch(IOException iox)
{
filterConfig.getServletContext().log(iox.getMessage());
}
} public void destroy()
{
}
}
web.xml加上<filter>
<filter-name>encodefilter</filter-name>
<filter-class>com.genersoft.netbank.common.EncodeFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>encodefilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>