I am trying to find a way to invoke a piece of java code within the JSP using HTML form
You can't do this since JSP rendering happens on server-side and client would never receive the Java code (ie. the invokeMe() function) in the returned HTML. It wouldn't know what to do with Java code at runtime, anyway!
What's more, tag doesn't invoke functions, it sends an HTTP form to the URL specified in action attribute.