Welcome to the JavaRanch, Sai!
Tomcat-based webapps can definitely call external programs, including shell scripts, using the Runtime.exec() or similar techniques.
There is no built-in scanner support for Java, but if you have a Native class that implements a scanner API, you can use that.
The only restrictions are that whatever you do must be allowable for the userId that the Tomcat server is running under.
A bigger problem is logistics. Webapps run on servers, and servers are often locked away somewhere which means that the scanner
unit might not be physically accessible to some or all users.
If you were thinking of scanning using a unit attached to a user's desktop, however, there are bigger issues. One of them is that HTTP protocol wasn't designed to work with scanning devices. You can scan on the desktop and transmit the image to a server, but actually having the server run the scanner is basically not possible. About the closest you could come would be to embed an
applet with the scanner control code on a web page. But unsigned applets are prohibited from the use of resources needed to operate the scanner, so you'd have to use a signed applet, and that can be a real annoyance.