这还是编码问题,价格过滤器就可以了。
看看这里:
http://www.blogjava.net/rickhunter/articles/33571.html
看看这里:
http://www.blogjava.net/rickhunter/articles/33571.html
解决方案 »
- 求解决!!!删了重做.还是这个情况。数据库查询是两表联查!
- 关于泛型和Spring扫描注入请教.
- struts2标签内如何提交变量
- 如何用HQL分组并排序后获得每组前十名
- 项目名,更改之后,问题....请大侠帮忙....
- ejbRemote业务接口和实现这个接口的Bean类是一对一的吗?
- 有关ibatis底层SQL语句通过log4j在控制台显示的问题
- Url中的中文传输问题,Jdk 1.3.08 App server Websphere 3.5--在线等
- 实施J2EE风险有多大?
- ###EJB QL里面l的模糊查询###
- 求助:关于开源软件License的问题
- 怎样对hibernate+spring测试进行测试?
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class SetCharacterEncodingFilter implements Filter {
protected String encoding = null;
protected FilterConfig filterConfig = null;
protected boolean ignore = true; public void destroy() {
this.encoding = null;
this.filterConfig = null;
} public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// Conditionally select and set the character encoding to be used
if (ignore || (request.getCharacterEncoding() == null)) {
String encoding = selectEncoding(request); if (encoding != null) {
request.setCharacterEncoding(encoding);
}
} // Pass control on to the next filter
chain.doFilter(request, response);
} public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
this.encoding = filterConfig.getInitParameter("encoding"); String value = filterConfig.getInitParameter("ignore"); if (value == null) {
this.ignore = true;
} else if (value.equalsIgnoreCase("true")) {
this.ignore = true;
} else if (value.equalsIgnoreCase("yes")) {
this.ignore = true;
} else {
this.ignore = false;
}
} protected String selectEncoding(ServletRequest request) {
return (this.encoding);
}
}然后再到web.xml里面加入下面的语句
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>包路径.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>gb2312</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>