Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72E5510AFA for ; Wed, 26 Feb 2014 21:31:59 +0000 (UTC) Received: (qmail 2174 invoked by uid 500); 26 Feb 2014 21:31:52 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 2127 invoked by uid 500); 26 Feb 2014 21:31:49 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 1793 invoked by uid 99); 26 Feb 2014 21:31:38 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 21:31:38 +0000 Received: from localhost (HELO mail-yh0-f47.google.com) (127.0.0.1) (smtp-auth username lukaszlenart, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 21:31:38 +0000 Received: by mail-yh0-f47.google.com with SMTP id c41so1736682yho.34 for ; Wed, 26 Feb 2014 13:31:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=a8Ea7Ag1EXk3X2pNbUhZXmwYJO2htEaStRBTNpcsAPk=; b=mXPU0+imLX+q16B9nsyCTbrEd25IYx2xL8GaFHOUVTXfNlNAdYRwZsU2vf8jWL48aH 0VH7mFDGt/2P8fcNtH9J0BQCVaBLl9elH9tvTC9GE+/XAfUMNAv6XXMG0C7TbWZ1KytG Ku1KkZvOoSTmkiZ95j+FJEjlOEXzoWeeMtfiOCGavafi9xCljwxviH7iEGru/dHIOQq+ MH/9gRwNNklHHVyi121quQFoQM2HNM6yJwIfosYzaZSYRt1iMzrv6xvXQYfKCZXtUoaj ym9yPzyU1pIvr67TlHZKhizY0oxNfRnfXKP10HItm4X3ir04B3g1zHu/QaBV3bH9+ckK Xe8g== X-Received: by 10.236.126.162 with SMTP id b22mr10350449yhi.72.1393450297116; Wed, 26 Feb 2014 13:31:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.170.69.212 with HTTP; Wed, 26 Feb 2014 13:31:17 -0800 (PST) In-Reply-To: <763c2f0a30ef31c2007b020882e07dc8@idealogic.com.br> References: <615f9ab1a21cc08c6adce8df9e0ae0bc@idealogic.com.br> <763c2f0a30ef31c2007b020882e07dc8@idealogic.com.br> From: Lukasz Lenart Date: Wed, 26 Feb 2014 22:31:17 +0100 Message-ID: Subject: Re: Rest + JSON To: Struts Users Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The simplest way is to prepare a patch or Pull Request via GitHub - then I can easily review your proposal 2014-02-26 17:17 GMT+01:00 Felipe Lorenz : > Hello Lukasz, > > There is any impact if we add the following code in the JsonLibHandler > class: > > JsonConfig jsonConfig =3D new JsonConfig(); > jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); > > Just right above the line: > > if (target !=3D null && sb.length() > 0 && sb.charAt(0) =3D=3D '[') { > > And use it? > > I can't see a reason to not use it. Since it is throwing Exception in the > actual code at same time will not make difference if my object does not > contain a cyclic reference. > > What is your opinion? > > Also, it is just a workaround for the cyclic problem. I still want to hav= e > same control over the results, using ContentTypeHandler, as in the > json-plugin. > > There is a way to read some parameter coming from the request by the > ContentTypeHandler? > > Thanks, > Felipe Lorenz > > Em 26/02/2014 10:02, Lukasz Lenart escreveu: >> >> You can always share your work as a patch or a plugin ;-) >> >> 2014-02-26 14:00 GMT+01:00 Felipe Lorenz : >>> >>> Thanks Lukasz, I think I=C2=B4ll create a CustomContentTypeHandler. >>> >>> Em 26/02/2014 04:21, Lukasz Lenart escreveu: >>>> >>>> >>>> 2014-02-25 19:08 GMT+01:00 Felipe Lorenz >>>> : >>>>> >>>>> >>>>> Hi, >>>>> >>>>> I was not clear with my doubt. I dont=C2=B4t want to use json-plugin,= since >>>>> rest-plugin already has a json solution. >>>>> >>>>> I wanna try to use 100% of rest-plugin json solution and, at same tim= e, >>>>> keep >>>>> the control over the data is returned. >>>> >>>> >>>> >>>> I think the only option you have is to write your own >>>> ContentTypeHandler [1] and override built-in JSON handler >>>> >>>> [1] >>>> >>>> >>>> http://struts.apache.org/release/2.3.x/docs/rest-plugin.html#RESTPlugi= n-CustomContentTypeHandlers >>>> >>>> >>>> Regards >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>> For additional commands, e-mail: user-help@struts.apache.org >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org