Skip to main content

[jax-rs-spec issues] [JIRA] Commented: (JAX_RS_SPEC-61) Improved marshalling for string-based parameters

  • From: "jbaas (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [jax-rs-spec issues] [JIRA] Commented: (JAX_RS_SPEC-61) Improved marshalling for string-based parameters
  • Date: Tue, 24 Apr 2012 03:08:08 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated


    [ 
http://java.net/jira/browse/JAX_RS_SPEC-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=338438#action_338438
 ] 

jbaas commented on JAX_RS_SPEC-61:
----------------------------------

If I may add a suggestion: the RESTEasy method works only for creating 
instances of that type. The Jersey StringReaderProvider does the same thing, 
but additionally it allows you to create an instance of a subclass.

Let's say you have an (abstract?) superclass with subclasses. If the 
subclasses have the same logic for converting from string to instance, there 
is currently no way to put this logic in one place. With Jersey's 
StringReader method it is possible to do so. I use it for fetching domain 
objects from a database using the primary key.

> Improved marshalling for string-based parameters
> ------------------------------------------------
>
>                 Key: JAX_RS_SPEC-61
>                 URL: http://java.net/jira/browse/JAX_RS_SPEC-61
>             Project: jax-rs-spec
>          Issue Type: New Feature
>            Reporter: robc
>             Fix For: 2.0
>
>
> (Email from Bill Burke, 
> http://java.net/projects/jax-rs-spec/lists/jsr339-experts/archive/2011-03/message/29)
> - Param marshalling: 
> http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/StringConverter.html
>  
> An excerpt:
> @PathParam, @QueryParam, @MatrixParam, @FormParam, and @HeaderParam are 
> represented as strings in a raw HTTP request. The specification says that 
> these types of injected parameters can be converted to objects if these 
> objects have a valueOf(String) static method or a constructor that takes 
> one String parameter. What if you have a class where valueOf() or this 
> string constructor doesn't exist or is inappropriate for an HTTP request? 
> Resteasy has 2 proprietary @Provider interfaces that you can plug in...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[jax-rs-spec issues] [JIRA] Commented: (JAX_RS_SPEC-61) Improved marshalling for string-based parameters

jbaas (JIRA) 04/24/2012
 
 
Close
loading
Please Confirm
Close