I am working on a JSP file that contains three dropdown boxes labeled "countries", "regions", and "cities". My goal is to populate the regions based on the selected country, and the cities based on the selected region. I have managed to achieve this using Java and Javascript parameters on the same page, however, every click on the dropdown lists results in the page refreshing, which I want to avoid.
The data for "countries", "regions", and "cities" is retrieved from JSON data within the Java code "<%...%>" on the same page.
I attempted to utilize AJAX for this process but was unable to find a functional example for passing parameters. If necessary, I am willing to split the page into smaller JSP files such as "countries.jsp", "regions.jsp", and "cities.jsp", but I need assistance with passing parameters between them. I am seeking guidance and practical examples of implementing JSP Ajax with parameters, without relying on jQuery. My aim is to accomplish this using pure JS.
I welcome your suggestions and any examples you may have for implementing JSP Ajax with parameters.