'Transform WSDLtoJava in Spring boot and JSP

I have a JSP page and a Spring boot controller, in the jsp i have a form with a select and options when i choose the option i need to pass that value to a java code to transform WSDL to java classes. How can i do it?

<form id="form" action="genclasses" method="post">
        <select name="WSDLcat" class="custom-select ml-2" id="inputGroupSelect04">
            <%
            ServiceClass[] services = (ServiceClass[]) request.getAttribute("services");
            %>

            <c:forEach items="${services}" var="service">
                <option id="WSDL" value="${service.getWsdl()}">
                    ${service.getNombre()}</option>
            </c:forEach>
        </select>
        <input class="btn btn-outline-secondary align-right" id="genclases" type="submit" onclick="generarClases()" value="Generar Clases">
</form>

    

String[] params= {"-d","./src/main/resources/generatedFiles","HERE I NEED THE VALUE OF THE OPTION"};
    WSDLToJava.main(params);
    
    ZipUtil.pack(new File("./src/main/resources/generatedFiles"), new File("./src/main/resources/generated.zip"));

I cannot do it in java inserted in jsp becasuse i need to use different libraries and i do not know how to pass it to the controller or do it in the same page. Any help?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source