ServletInputStream and Dynamo


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ServletInputStream and Dynamo

  1. #1
    Marcia Guest

    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();
    }


  2. #2
    Paul Clapham Guest

    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.devx.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();
    > }
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center