Categories
Computing Java Web Development

Lucene and friends

As my current project draws to a close, I need to deliver document search capabilities.
SQL Server, despite how much I love it, requires you to have the documents reside *inside* the database for it to index them. That is ugly. So I ventured out and went with much-hyped and totally-cool Lucene from Apache. I am an Apache bitch, and why not, I love them and they love everyone.

So I ran some tests and everything works great and I can sleep at night.

Today, Saturday, after we release the first iteration of the live site and I am in post-stress bliss, I discover that Lucene does not index PDFs out of the box. Text is cool, PDF ain’t cool.

Rapid searches turn into slow searches, during which I find bizarro projects such as Docco or Multivalent – both of which are as hostile and not helpful as they get. Do you REALLY expect to documentation? Blech! RTF(non-existent)M!
I even stumble across over-the-top solutions that provide you a complete web application that will index the ass off your website – Zilverline, and that’s very cool but I need a component or library I can integrate into my code and Lucene was so neat and fit that bill.

Finally, I come across PDF Box – which pretty much was it. It reads PDFs, converts them to text, and Lucene can now play with PDFs!

Now on to Word where Apache’s Jakarta POI is supposed to provide the goods for Excel, Word and even PowerPoint… am I being too optimistic?

Share
Categories
Java

JSP/Servlets and Form Checkboxes

This one caught me off-guard.

Suppose you have a form with multiple checkboxes that share the same name. You check off some boxes and submit the form.

In ColdFusion, checkbox values submitted from a form are presented to you inside a variable that contains a comma-delimited list of the checked values.

Java does not play the same way.

In Java, what you get is an array of Strings that is returned when you as the request object for the parameter of the name the checkboxes share. You then need to iterate through the array to get all the values and do whatever you wish with them.

What surprised me is that there is really no mention of this behavior in any of the books I checked or around the web. Well, it is noted now.

Share
Categories
Java

Eclipse not showing you pop-up JavaDoc?

If you are using Eclipse and it does not show you the JavaDoc information as you would have expected it to, maybe it is using the wrong Java Runtime (JRE).

To fix this open Eclipse’s Preferences (under the Window menu). Click on + sign next to ‘Java’ and click on ‘Installed JREs’. Now, click ‘Add’ and a window will open. From it, click ‘Browse’ next to the box saying ‘JRE Home directory’ and in the window that will open, traverse the directory structure and select the root folder for your installation of your Java SDK. Select it and click OK. The rest of the form in the window will be populated automatically and your JavaDocs will suddenly be more helpful.

Kudos to Rob for finding this one.

Share
Share