From: Michael S. <sta...@us...> - 2005-10-06 01:07:39
|
Update of /cvsroot/archive-access/archive-access/projects/nutch/src/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1231/src/web Modified Files: search.jsp Log Message: * conf/nutch-site.xml.all Change value for indexer.maxMergeDocs. * src/web/search.jsp Chnage comments. Also force encoding. response.encodeURL will noop if already some encoding. Index: search.jsp =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/nutch/src/web/search.jsp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** search.jsp 4 Oct 2005 00:13:22 -0000 1.21 --- search.jsp 6 Oct 2005 01:07:32 -0000 1.22 *************** *** 24,28 **** %><% NutchBean bean = NutchBean.get(application); ! // set the character encoding to use when interpreting request values request.setCharacterEncoding("UTF-8"); --- 24,29 ---- %><% NutchBean bean = NutchBean.get(application); ! ! // Set the character encoding to use when interpreting request values request.setCharacterEncoding("UTF-8"); *************** *** 35,44 **** queryString = ""; } ! // Why do we have to do this? We've set the character encoding for the ! // request above with request.setCharacterEncoding? But Lukas and Oskar ! // say this works. queryString = new String(queryString.getBytes("ISO-8859-1"), "UTF-8"); - String htmlQueryString = Entities.encode(queryString); int start = 0; // first hit to display String startString = request.getParameter("start"); --- 36,45 ---- queryString = ""; } ! // From Oskar and Lukas. Shouldn't be needed but looks like it is. ! // Would be consistent with this advice: ! // http://www.jguru.com/faq/view.jsp?EID=391295 queryString = new String(queryString.getBytes("ISO-8859-1"), "UTF-8"); String htmlQueryString = Entities.encode(queryString); + int start = 0; // first hit to display String startString = request.getParameter("start"); *************** *** 91,99 **** String base = requestURI.substring(0, requestURI.lastIndexOf('/')); String rss = request.getContextPath() + "/opensearch?query=" + ! response.encodeURL(queryString) + "&hitsPerDup=" + hitsPerDup + ((start != 0)? "&start=" + start: "") + params; - %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <% --- 92,102 ---- String base = requestURI.substring(0, requestURI.lastIndexOf('/')); + // URLEncoder.encode the queryString rather than just use htmlQueryString. + // The former will take care of other than just html entities in case its + // needed. String rss = request.getContextPath() + "/opensearch?query=" + ! URLEncoder.encode(queryString, "UTF-8") + "&hitsPerDup=" + hitsPerDup + ((start != 0)? "&start=" + start: "") + params; %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <% |