• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem: WOActionResult with ObjectOutputStream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem: WOActionResult with ObjectOutputStream


  • Subject: Re: Problem: WOActionResult with ObjectOutputStream
  • From: "Frederico Lellis" <email@hidden>
  • Date: Wed, 25 Apr 2007 16:11:47 -0300

SOLVED!

TY Chuck, now i can trade objects between my J2me midlet and webObject app

cheers.


2007/4/25, Chuck Hill <email@hidden >:
If it is a ByteArrayOutputStream stream you can do this:

         WOResponse response = context().response();
         ByteArrayOutputStream baos =  // I don't know where you get
this from...
         response.setContentStream(new ByteArrayInputStream
(baos.toByteArray()), 8192, baos.size());

        // If  this is a download...
         String contentDisposition = "attachment; filename=\"" file
name + "\"";
         response.setHeader(contentDisposition,
WOApplication.ContentDispositionHeaderKey);
         response.setHeader("MIME TYPE GOES HEREl",
WOApplication.ContentTypeHeaderKey);
         response.disableClientCaching();
         response.removeHeadersForKey("Cache-Control");
         response.removeHeadersForKey ("pragma");

        return response;

If it is not a ByteArrayOutputStream, then Google "Java convert
output stream input stream"

Chuck


On Apr 25, 2007, at 6:56 AM, Frederico Lellis wrote:

> I'm trying to have a WOActionResult called from a directAction
> return an ObjectOutputSteam but i haven't had much luck , the
> serialization is working fine , but i cant seem to send the
> object . can anyone give me  a hand ?
> thanks in advance
>
> --
> --
> ******************************************************
>
> Frederico L. Albuquerque
>
> \o/
> |    Moleque de Idéias Educação e Tecnologia Ltda
> / \
>
> e-mail: email@hidden
>
> email@hidden
>
> ******************************************************
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.

--

Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects








--
--
******************************************************

Frederico L. Albuquerque

\o/
|    Moleque de Idéias Educação e Tecnologia Ltda
/ \

e-mail: email@hidden

email@hidden

******************************************************
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Problem: WOActionResult with ObjectOutputStream (From: "Frederico Lellis" <email@hidden>)
 >Re: Problem: WOActionResult with ObjectOutputStream (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: I'm killing my database
  • Next by Date: Re: I'm killing my database
  • Previous by thread: Re: Problem: WOActionResult with ObjectOutputStream
  • Next by thread: Get fetched raw row into an editing context
  • Index(es):
    • Date
    • Thread