dev@jsr311.java.net

Re: JSR311: POSTed form data

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 15 Feb 2008 14:42:13 -0500

On Feb 15, 2008, at 2:21 PM, Marc Hadley wrote:
>
> @Path("foo")
> @ConsumeMime("application/x-www-form-urlencoded")
> public class Foo {
>
> @POST
> public void register(FormData data) {
> // do something with form data
> }
>
> public static class FormData {
> String name,
> int serial,
> String rank }
> }
>
Sigh, more haste, less speed. I meant:

@Path("foo")
@ConsumeMime("application/x-www-form-urlencoded")
public class Foo {

  @POST
  public void register(FormData data) {
    // do something with form data
  }

  public static class FormData {
    String name;
    int serial;
    String rank;
  }
}

> The main difference is that the former requires lots of @FormParam
> annotations while the latter requires a new class that encapsulates
> the form data.
>
> Marc.
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.