Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

ServletInputStream and Dynamo

I have writing a java package that will upoad a file, read, parse data and
update the data base.
This project works fine in JavaServer and Tomcat, but as soon I put in
Dynamo it stop working.
The code stop on the readLine and just hang in there, I'm receiving the file
from a VB HTTP comand line or Upload from a HTML page.
I'm also using it as a DynamoServlet and as a
public void service (DynamoHttpServletRequest req,
DynamoHttpServletResponse res)
throws ServletException, IOException

because the doPost does not get call under Dynamo.
I have called Dynamo has been 3 days and no one was able to help me. They
admited that there is a bug in Dynamo.
Please can some one help me.
My dead line is this coming friday.

Thanks

ServletInputStream in = req.getInputStream();

String readLine(in)

private String readLine(ServletInputStream in) throws IOException {
StringBuffer sbuf = new StringBuffer();
int result;
String line;
System.out.println("reading" );
do {
result = in.readLine(buf, 0, buf.length); // does +=
if (result != -1) {
sbuf.append(new String(buf, 0, result, "ISO-8859-1"));
}
} while (result == buf.length); // loop only if the buffer was filled

if (sbuf.length() == 0) {
return null; // nothing read, must be at the end of stream
}

sbuf.setLength(sbuf.length() - 2); // cut off the trailing \r\n
return sbuf.toString();
}
[1522 byte] By [Marcia] at [2007-11-9 21:19:05]
# 1 Re: ServletInputStream and Dynamo
Suggests to me that you should stop using this Dynamo product and start
using something else.

Marcia <isoint@msn.com> wrote in message news:3a7115a2$1@news.dev-archive.com...
>
> I have writing a java package that will upoad a file, read, parse data and
> update the data base.
> This project works fine in JavaServer and Tomcat, but as soon I put in
> Dynamo it stop working.
> The code stop on the readLine and just hang in there, I'm receiving the
file
> from a VB HTTP comand line or Upload from a HTML page.
> I'm also using it as a DynamoServlet and as a
> public void service (DynamoHttpServletRequest req,
> DynamoHttpServletResponse res)
> throws ServletException, IOException
>
> because the doPost does not get call under Dynamo.
> I have called Dynamo has been 3 days and no one was able to help me. They
> admited that there is a bug in Dynamo.
> Please can some one help me.
> My dead line is this coming friday.
>
> Thanks
>
> ServletInputStream in = req.getInputStream();
>
> String readLine(in)
>
> private String readLine(ServletInputStream in) throws IOException {
> StringBuffer sbuf = new StringBuffer();
> int result;
> String line;
> System.out.println("reading" );
> do {
> result = in.readLine(buf, 0, buf.length); // does +=
> if (result != -1) {
> sbuf.append(new String(buf, 0, result, "ISO-8859-1"));
> }
> } while (result == buf.length); // loop only if the buffer was filled
>
> if (sbuf.length() == 0) {
> return null; // nothing read, must be at the end of stream
> }
>
> sbuf.setLength(sbuf.length() - 2); // cut off the trailing \r\n
> return sbuf.toString();
> }
>
Paul Clapham at 2007-11-11 23:06:18 >