I wouldn't have a problem with using the GSON project, it's another
community maintained, battle tested project.  From your examples it should
probably have a Struts Result object wrapped around it to make it easier to
use, but that's beside the point.

<horse level="high" status="on">

My problem is companies that are short sighted enough to think that spending
developers time to produce libraries of code that are not directly related
to their core business (like a medical or insurance company building a JSON
library) is going to be a good thing for their bottom line.  It's not!  It's
going to add development and maintenance tasks to their projects that take
away from developing new and better features that would enhance their core
business proposition.

As developers, when we are presented with a new projects we need to separate
the core business aspects of the project from the purely technological
aspects.  We then need to do a little research to find the best fitting,
most mature tool to accomplish the technical goals and champion that as the
way to spend more time on the business differentiating goals of the project.
 Once they see they can get more features in less time for less money,
they'll come around.

</horse type="dead" reason="kicked">

On Wed, Mar 9, 2011 at 8:34 AM, Paul Zepernick <
pzepern...@commercebenefitsgroup.com> wrote:

>  We are using the Google Gson project to handle converting our objects /
> maps to json.  I will have to take a look at the plugin, I was not even
> aware of its existence.
>
> http://code.google.com/p/google-gson/
>
> We put the result from Gson into an InputStream and send it back out using
> the stream result
>
>          <result name="success" type="stream">
>                          <param name="contentType">application/json</param>
>                          <param name="inputName">jsonStream</param>
>                          <param name="bufferSize">1024</param>
>                 </result>
>
> Here is the line from our action that is setting up the InputStream from
> Gson.
>
> setJsonStream(new ByteArrayInputStream(new
> Gson().toJson(jsonResult).getBytes()));
>
>
> jsonResult is a Map, but could be any object or list of Objects.
>
> Paul
>
>
> -----Original Message-----
> From: Harsh C [mailto:hchau...@gmail.com <hchau...@gmail.com>]
> Sent: Wednesday, March 09, 2011 7:24 AM
> To: Struts Users Mailing List
> Subject: Re: Struts 2.0.11.1 question
>
> Thanks for the responses all. "Not blessed" just means that it is not in
> the
> list of s/w that we are allowed to work with.
>
> I ended up writing just a plain servlet for now to serve the JSON string
> which works well enough, except the JSON parsing part of course.
>
> HC
>
>
> On Mar 9, 2011 1:19 AM, "Maurizio Cucchiara" <maurizio.cucchi...@gmail.com
> >
> wrote:
> > What do you mean by "not blessed"?
> >
> > Maurizio Cucchiara
> >
> > Il giorno 09/mar/2011 00.24, "Harsh C" <hchau...@gmail.com> ha scritto:
> > Hi,
> >
> > I don't know if this is the right list for a question regarding 2.0.11.1,
> if
> > not please let me know the right forum.
> >
> > I am trying to use Struts 2.0.11.1 to work on an AJAX-ified app using
> Dojo.
> > Problem is, struts-json plugin is not blessed.
> >
> > Is there a way in which I can code an Action which returns a JSON string
> > without using the JSON plugin?
> >
> > --
> > *Thanks,
> > Harsh*
>
> *The information contained in this transmission contains
> confidential information that is legally privileged. This information is
> intended only for the use of the individual or entity named above. The
> authorized recipient of this information is prohibited from disclosing this
> information to any other party unless required to do so by law or regulation
> and is required to destroy the information after its stated need has been
> fulfilled.*
>
> *If you are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or action taken in reliance on the
> contents of these documents is strictly prohibited. If you have received
> this information in error, please notify the sender immediately by return
> email and arrange for the return or destruction of these documents.*
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

Reply via email to