Why can't you call the API from servlets? Writing a servlet to handle the requests IS the obvious thing to do. This is my JSP file name is Index.jsp it has simle form and when user click calculate button result will show in result textbox without refresing a page. Sabarish Venkat wrote:As i thought of calling API through servlets in have to get all the functionality that present in API. Amit Ghorpade wrote:Next technically there is no difference in the functionality a JSP and servlet perform. In this case, you need to understand the below points on how the GET method will work. How to transfer data from JSP to servlet when submitting HTML form. How do you pass data from one JSP to another JSP? The cookies is used to store the user consent for the cookies in the category "Necessary". 4 How can a JSP receives the user submitted form data? Servlets are capable of handling complex requests obtained from the webserver. I use Ajax Asynchronous Verify that the account exists. 4. servlet sends data to a jsp page. As as alternative, you could hide the JSP page behind the servlet, and have the servlet to directly forward to the JSP page for a GET request, and do its work for a POST and then either forward to the JSP or redirect to itself. You can. The servlet doXxx() method will just be invoked with the current request/response. Locate the whereabouts of a federal inmate incarcerated from 1982 to the present. These cookies will be stored in your browser only with your consent. This asks the browser to create a new request for the servlet and (naturally) the new request doesn't know anything about the original request for the JSP. Make note of the URL mapping "/hello". You will then use the HttpServletRequest object to get the parameters that were passed as part of the form like so: Then, once you have the data from the form, it's relatively easy to add it to a database using a JDBC tutorial that is widely available on the web. Why are you trying to avoid this best practice? Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. Pass data from Javascript to Servlet through AJAX, How to learn Java with no programming experience, The Difference Between Java and JavaScript. I have been trying to pass the data from a JSP page to a Java Servlet without using form. It will be difficult for me to find each and every functions that are doing some internal operations of API. You should make sure that you have specified the name attribute of the HTML form input fields (,