users@jersey.java.net

RE: [Jersey] Web applications using XMLHttpRequest and JAX-RS REST/JSON Web Services

From: Robertson, Jeff <jeff.robertson_at_digitalinsight.com>
Date: Mon, 10 Nov 2008 15:35:34 -0500

Re: Josh's gripes, I ended up wriging myself a class like this:


public class RestException extends WebApplicationException {
        
        public RestException(Throwable cause, int status, String message) {
                super(cause,
                                Response
                                .status(status)
                                .entity(message)
                                .type("text/plain")
                                .build()
                );
        }

        public RestException(int status, String message) {
                super(
                        Response
                                .status(status)
                                .entity(message)
                                .type("text/plain")
                                .build()
                );
        }

}




> -----Original Message-----
> From: Eduardo Pérez Ureta [mailto:edpeur_at_gmail.com]
> Sent: Monday, November 10, 2008 3:26 PM
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] Web applications using XMLHttpRequest
> and JAX-RS REST/JSON Web Services
>
> Like Josh:
> http://joshdevins.blogspot.com/2008/10/jax-rs-woes-continue.html
> I would like to send a text/plain response with a message
> when I output a 401 Unauthorized response. Is there a way to
> do that with JAX-RS ?
>
> Craig McClanahan wrote:
> > Are there particular aspects of CSRF that you are concerned about?
> No, I just wanted to know if there is a defacto standard way
> to do that using JAX-RS
>
> Eduardo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>