Why do you want to do that Dhriti? What do you want to accomplish by doing that? Can you post this information? That will enable us to give you a better approach on how to do it. It is generally considered not a good practice to embed java scriptlets in JSPs. There are always exceptions to rules; however if you can get away from embedding scriptles in JSPs you should.
It's really not an issue of whether there are scriplets in the JSP page or not. The point is, any scriplets are run on the server long before the page is sent to the browser, and there is no way to "trigger" one of the scriplets on a client-side event like onsubmit.
you can submit to the same jsp with a value assigned to a hidden form field. Depending upon the value of this hidden field you can get the neccesary scriptlet to be executed on the server. I prefer this way when the same gui is to be maintained through a sequence of dynamic selections like country>state etc.