Re: Problems with DirectAction Response header

From: Frederico Lellis (frederico.lelli..mail.com)
Date: Tue May 22 2007 - 15:41:04 EDT

  • Next message: Lachlan Deck: "Re: Is it time for a port to eclipse 3.3?"

    Sorry guys type wrong mail list.

    2007/5/22, Frederico Lellis <frederico.lelli..mail.com>:
    >
    > 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: frederic..oleque.com.br
    >
    > frederico.lelli..mail.com
    >
    > ******************************************************

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

    Frederico L. Albuquerque

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

    e-mail: frederic..oleque.com.br

    frederico.lelli..mail.com

    ******************************************************



    This archive was generated by hypermail 2.0.0 : Tue May 22 2007 - 15:42:06 EDT