org.glassfish.jersey.examples.console.resources
Class FormResource

java.lang.Object
  extended by org.glassfish.jersey.examples.console.resources.FormResource

@Path(value="/form")
@Produces(value="text/html")
public class FormResource
extends java.lang.Object

A Web form resource, produces the form and processes the results of submitting it.


Constructor Summary
FormResource()
           
 
Method Summary
 Colours getColours()
           
 Response getForm()
          Produce a form from a static HTML file packaged with the compiled class
 java.lang.String processForm(MultivaluedMap<java.lang.String,java.lang.String> formData)
          Process the form submission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormResource

public FormResource()
Method Detail

getColours

@Path(value="colours")
public Colours getColours()

getForm

@GET
public 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(value="application/x-www-form-urlencoded")
public java.lang.String processForm(MultivaluedMap<java.lang.String,java.lang.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.


Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.