Hi Erik, thanks for the quick reply I am looking at this page http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html
Any chance there is a new version for 2.0? Or are there any 2.0 examples (other than the stock example)? On 8/23/06, Erik Hatcher <[EMAIL PROTECTED]> wrote:
On Aug 23, 2006, at 7:24 PM, Mag Gam wrote: > I am trying to do a Query parse line in a doGET method (J2EE). > > I keep getting this type of message; > unreported exception org.apache.lucene.queryParser.ParseException; > must be > caught or declared to be thrown > > Anyone have an example of a Class being thrown an exception? > > I would kindly appreciate it. The simplest thing would be something like this in a servlet: try { Query query = parser.parse(...); } catch (ParseException pe) { throw new IOException(pe.getMessage()); } But you may not want the user to see that harsh of an error from your servlet when an unparsable expression is used. Typically that exception is caught and a friendlier message is provided to the user. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]