I am trying to find a way to invoke a piece of java code within the JSP using HTML form
java code
Sorry,not possible.
Jsp lies on server side and html plays on client side unless without making a request you cannot do this :)
server
html
client side
request