Hi,

I have a requirement to send a custom response which is an error xml along with 
the standard Http Status codes.

I found some information about it in bits and pieces and don't know how to make 
use of it. Can somebody help me about the same?

Things that I know:
1. Extend StatusFilter class to modify the representation of the statuses being 
returned.

I created 1 class as defined below

public class CustomStatus extends StatusFilter{

        public CustomStatus(Context context, StatusService statusService){
                super(context, statusService);
        }
        
        public CustomStatus(Context context, boolean overwriting, String email,
                        Reference homeRef) {
                super(context, overwriting, email, homeRef);
        }

        @Override
        protected Representation getRepresentation(Status status, Request 
request,
                        Response response) {
                StringRepresentation sr = new 
StringRepresentation("<substatuscode>640</substatuscode>", 
MediaType.APPLICATION_ALL_XML);
                return sr;
        }
}

Now, I need to replace it with the StatusFilter class in some configuration or 
in the code of the resource. I don't know how to do that.

Any help would be much apperciated.

Thanks
Nitin

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2769167

Reply via email to