<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1515" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>Hi
list,</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>I have several
problems with the opencms search engine according the query string.If I insert
something like " !!test " I'll get an error <<null>>. (" ?test "
works)</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>Can somebody help me
avoiding these errors? I'm testing the query string if it has at least 3
characters. I do not have more tests. My form method is
post.</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>Her a snipped of my
search form:</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2>[...]</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2>if(request.getParameter("query").length() >
2){<BR> session.setAttribute("query",
request.getParameter("query"));<BR> response.sendRedirect(response.encodeRedirectURL("searcher.jsp"));<BR>[...]</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>Here is the code of
my search.jsp</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2> <%</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>//get the query
string from a user input<BR> String query = (String)
session.getAttribute("query");<BR> if(query == null ||
"".equals(query))<BR> throw new Exception("empty query
is invalid query");</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>//which result page
should be displayed<BR> int currentPage;<BR> String pageNumberStr =
request.getParameter("page");<BR> if(pageNumberStr == null ||
"".equals(pageNumberStr)){<BR> currentPage =
1;<BR> } else {<BR> currentPage = new
Integer(pageNumberStr).intValue();<BR> }</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2>[...]</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>// How many matches
should be displayed<BR> searcher.setMatchesPerPage(7);<BR>
searcher.setPage(currentPage);</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>//the minimum query
length<BR> searcher.setQueryLength(3); </FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>//set the search
query<BR> searcher.setQuery(query);<BR> List results =
searcher.getSearchResult();</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2> int
resultsCount = searcher.getSearchResultCount();<BR> int resultsPerPage =
searcher.getMatchesPerPage();</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2> int pages=
resultsCount / resultsPerPage;<BR> if ((resultsCount % resultsPerPage) !=
0) {<BR> pages++;<BR> }</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2>%></FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>It may help if I
could set an error page or something like that. Any idea?</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial size=2>thanks for your
help</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2>Matthias</FONT></SPAN></DIV>
<DIV><SPAN class=609311411-11102005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV class=Section1>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">-----------------------------------------------------------------<?xml:namespace
prefix = o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Matthias Neher<SPAN
style="mso-spacerun: yes">
</SPAN>Fon: +49-7541-6047-143<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN lang=EN-GB
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-ansi-language: EN-GB">doubleSlash
Net-Business GmbH<SPAN style="mso-spacerun: yes">
</SPAN>Fax: +49-7541-6041-111<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Müllerstr. 12 B<SPAN
style="mso-spacerun: yes">
</SPAN>Matthias.Neher@doubleSlash.de<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="LINE-HEIGHT: 10pt; mso-line-height-rule: exactly"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">D-88045 Friedrichshafen<SPAN
style="mso-spacerun: yes">
</SPAN><A href="http://www.doubleslash.de/">http://www.doubleSlash.de</A>
</SPAN><SPAN
style="FONT-SIZE: 10pt; mso-bidi-font-size: 12.0pt"><o:p></o:p></SPAN></P></DIV>
<DIV> </DIV></BODY></HTML>