Problems with DirectAction Response header
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