We used JTwain to facilitate scanning in a java based web application. This tool is an applet which you can plug it in your page and the rest is just selecting the local scanner on the client machine and proceeding with scanning and uploading the file to the server.