Class FormResource


  • @Path("/form")
    @Produces("text/html")
    public class FormResource
    extends Object
    A Web form resource, produces the form and processes the results of submitting it.
    • Constructor Detail

      • FormResource

        public FormResource()
    • Method Detail

      • getColours

        @Path("colours")
        public Colours getColours()
      • getForm

        @GET
        public jakarta.ws.rs.core.Response getForm()
        Produce a form from a static HTML file packaged with the compiled class
        Returns:
        a stream from which the HTML form can be read.
      • processForm

        @POST
        @Consumes("application/x-www-form-urlencoded")
        public String processForm​(jakarta.ws.rs.core.MultivaluedMap<String,​String> formData)
        Process the form submission. Produces a table showing the form field values submitted.
        Parameters:
        formData - the data from the form submission
        Returns:
        a dynamically generated HTML table.