users@jersey.java.net

[Jersey] Re: Add standard mechanism to Redirect after POST/PUT/DELETE

From: Jose Antonio Illescas Del Olmo <jantonio.illescas_at_rbcdexia-is.es>
Date: Mon, 08 Aug 2011 11:22:01 +0200

Pavel, your solution disperse the HTTP configuration across multiple
files. I interest on configure my REST service in "single file":
annotations on my source code (as JAX-RS does)

   I will try custom annotations (to configure another HTTP features,
not included on JAX-RS) and using a combination of guice+sevlet filters
react to this my (custom) configuration

Pavel, I use dynamic redirects on my applications, for example:

  · after put/post/errors redirect to previous URL (the URL with post
button) and include a new http parameter whith error message (this
parameter shows a message on page top)
  · on some lists we can add/modify/delete items after any modification
we redirect to list

Jose


On 08/08/2011 10:26, Pavel Bucek wrote:
> question is whether this shouldn't be solved on different level.. I
> can imagine these rules in .htaccess or similar container settings,
> but why would we want to bother user app? It will degrade performance
> in both ways - app will have to handle more requests than necessary
> and redirect itself could be faster when handled in lower layer..
>
> .. and about dynamic redirect.. do you have solid usecase for that?
> btw you can do this easily by container filter(s) already, but you
> would need to do in on http level.. (as stated previously..)
>
> Pavel
>
> On 8/5/11 5:56 PM, Jose Antonio Illescas Del Olmo wrote:
>> Your opinion about this new feature?
>>
>>
>> Add standard mechanism to Redirect after POST/PUT/DELETE
>> --------------------------------------------------------
>>
>> Key: JAX_RS_SPEC-120
>> URL:http://java.net/jira/browse/JAX_RS_SPEC-120
>> Project: jax-rs-spec
>> Issue Type: New Feature
>> Reporter: joseaio
>> Priority: Minor
>>
>>
>> Allows @POST, @PUT and @DELETE with String param to allows redirection.
>>
>> example:
>>
>> @Path("/some")
>> public class Some {
>>
>> @POST("/other-resource") => this allows redirection after POST (if
>> no error/exception) => I think that redirection is usefull on
>> HTML/XHTML mediaTypes only
>> @Produces("text/html")
>> public long create (...)
>>
>>
>> see:http://en.wikipedia.org/wiki/Post/Redirect/Get
>>
>> Another interesting feature is add a dynamic URL generator on @POST,
>> @PUT and @DELETE
>>
>> @POST(MyDynamicURLGenerator.class) => sometimes is necessary
>> dynamic/programatic URL for redirections (using another value type
>> for @POST, @PUT and @DELETE annotations)
>>
>>
>>
>>
>
>