• 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
Problems with DirectAction Response header
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with DirectAction Response header


  • Subject: Problems with DirectAction Response header
  • From: "Frederico Lellis" <email@hidden>
  • Date: Tue, 22 May 2007 16:41:31 -0300

Hi all,
Im trying to set a WOResponse with a stream that conteains a  Vector with some objects and give it back to my J2me app.
When i run WebObjects app at my local host its all ok, it works fine and the objects perfectly deserializable at j2me Side, but when i run the WebObjects App at Server i have this exception:

java.io.UTFDataFormatException

when i will deserialize my Vector like this:

                    raw = new byte[contentlength];
                    length = bais.read( raw );
                    ByteArrayInputStream baip = new ByteArrayInputStream( raw );
                    ObjectInputStream ois = new ObjectInputStream( baip );
                    reply = (Vector) ois.readObject(); <-- here i have the exception.
                   
Is there anything i have to set im my DirectAction method, something like encoding or header?

this s my Method at DirectAction:

public WOActionResults getAssessmentPalmAction() throws IOException
    {

        String filtro = (String) request().formValueForKey( "todo" );

        Vector arg2 = new Vector();

        arg2.addAll( ConversorAssessmentPalm.AssessmentsConvertidos( filtro ) );

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        ObjectOutputStream oos = new ObjectOutputStream( baos );

        oos.writeObject( arg2 );

        WOResponse response = new WOResponse();

        response.setHTTPVersion( "HTTP/1.0" );
        response.setHeader( "application/octet-stream", "content-type" );
        response.setContentStream( new ByteArrayInputStream( baos.toByteArray() ), 8192, baos.size() );
        return response;
}

ty all.


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

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

  • Prev by Date: Re: Building WOLips projects from command line
  • Next by Date: Re: Building WOLips projects from command line
  • Previous by thread: Re: Building WOLips projects from command line
  • Next by thread: WOHyperlink, Direct Action and session id
  • Index(es):
    • Date
    • Thread