I have a JSP html based form. I want to do the post through my java code, i.e HttpURLConnection, OutputStreamWriter etc..
How do I make my form action process point towards my java class that is to do this post?
My aim is to have a:
- JSP page that has a form,
- Submit form
- Processing and response called out my java code that will generate a response (this is working fine)
- Response returned to the calling JSP page.
Really my issue is submitting the form, and send the processing to my java class?
Ok, here is an easy example on how to use servlet. What you actually need is a Servlet. A servlet is actually a java class. Check this example, replace
form.htmlwith yourjspand let me know if you have issues. This is a brief description of what a servlet is.