ant21 on Jul 7th, 2005Pebble 在 Tomcat 5 上的搜索问题
Pebble 1.8 在 Tomcat 5 上面的中文搜索问题终于解决了。
在这里下载修改过的 SearchAction.java 和 SearchAction.class。
把 SearchAction.class 放到 pebble.jar 里面。
重启 Tomcat,应该可以中文搜索了。
看了源文件后,明白了乱码原来是由于在 Tomcat 5 下面当 GET 的时候 setCharacterEncoding 不起作用导致的。patch 就是加上了:
if("GET".equalsIgnoreCase(request.getMethod())){ try { query = new String(query.getBytes("ISO8859_1"), request.getCharacterEncoding()); } catch (UnsupportedEncodingException [...]
ant21 on Jul 1st, 2005Pebble on Tomcat 5
发现 Pebble 在 Tomcat 5 下面搜索又变成乱码了!郁闷啊!在 Tomcat 4 下面都好好的嘛,中文显示和搜索都调好了,可一换到 5 下面怎么不行了呢?
在作者的 blog 上面,看到他说的:
I’ve not tried any of the JSP 2.0 containers because that’s just going
to open up a whole can of worms! On the other hand, I’ve just
downloaded Resin 2.1.12 and installed Pebble. No problems for me.
不过那是 2004 年的事情了。不管怎么说,还是自己慢慢调吧。在 Tomcat 4 下面,Pebble 1.8 [...]