Are you talking about a Java applet? That would be the way to embed a Java program within a webpage. Having said that, search is a complex process, and it really depends on how your site is built (ie: php, plain html etc) when implementing a search function for it.
No java scriplet.
I was not able to get one webpage which has an example of a moderate to easy java scriplet example. That is why I was asking. I think I will be learning this; it is a good discussion forum. So i am seeing, whether I can get some information.