Try to replace < with < and > with >, I am assuming your code is in a JSP file:
<% ... query += " AND CATEGORY<CONTAINS> (" + categoryQuery + ")"; ... %> ----- Original Message ----- From: "Chris Pratt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 23, 2002 5:06 PM Subject: Re: JSP String not reconizing a variable > Have you tried URLEncoding the String? I believe it would be something > like: > > query += java.net.URLEncoder.encode(" AND CATEGORY<CONTAINS> (" + > categoryQuery + ')'); > > (*Chris*) > > ----- Original Message ----- > From: "Lance Prais" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, October 23, 2002 2:55 PM > Subject: [SERVLET-INTEREST] JSP String not reconizing a variable > > > > I am trying to include "<CONTAINS>" in the building of a query string > but > > no matter what I try I can not get the browser to recognize it. > > > > This Line: > > query = query + " AND CATEGORY<CONTAINS> (" + categoryQuery + ")"; > > > > If the categoryQuery = "ALL" > > The result would be as follows: > > CATEGORY(ALL) As you see it completely ingnores the <CONTAINS> or > anything > > that is inclosed by <> > > > > //Category > > // If query is more than one word > > if (envCategory.length() > 0) { > > StringTokenizer st=new StringTokenizer(envCategory); > > //break the string up so that individual words in the query are now > > delimited by commas (implied accrue) > > while (st.hasMoreTokens()){ > > String tmpToken=st.nextToken(); > > categoryQuery=categoryQuery + tmpToken + "," ; > > } > > //trim off the trailing "," > > > categoryQuery=categoryQuery.substring(0,categoryQuery.length()-1); > > if (query.length() > 0) { > > query = query + " AND CATEGORY<CONTAINS> (" + > categoryQuery + ")"; > > } else { > > // query=categoryQuery; > > // query = "<ACCRUE> (CATEGORY<CONTAINS>\"" + query + "\", > > CATEGORY<CONTAINS>\"" + query + "\"<AND> Home, CATEGORY<CONTAINS>\"" + > query > > + "\",[20]('" + query + "'))"; > > > > } > > } > > ; [EMAIL PROTECTED] > > > > > ___________________________________________________________________________ > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > > of the message "signoff SERVLET-INTEREST". > > > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > > Resources: http://java.sun.com/products/servlet/external-resources.html > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > > > > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html