I need to post some data that one servlet that reads the
data(PostToCallParser), to another sevltet(CPP) that processes that data.
Both of my servlets are in the same directory
"/home/mahmoods/jsdk2.1/examples/WEB-INF/servlets".  When I run the
PostToCallParser, I get a FileNotFoundException.
I have added the class name in the servlets.properties file, and I have
restarted the server.
I would appreciate any help.
Thanks

Here is the entire code of the servlet that reads the data and calls the
second servelet.

import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class PostToCallParser extends HttpServlet {


    String email="[EMAIL PROTECTED]";
    String inputFile;
    String newLine = System.getProperty("line.separator");
    int x = 1;
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        try
        {
           URL source = new
URL("http://localhost:8080/examples/servlets/sh-versio
n");
           DataInputStream in = new DataInputStream(source.openStream());
           String aLine;
           inputFile="";
           while ((aLine = in.readLine()) != null)
           {
             inputFile=inputFile+newLine+aLine;
           }
           String inFile;
           URL url = new
URL("http://localhost:8080/examples/WEB-INF/servlets/CPP?inFile=inputFile");
           BufferedReader inStream = new BufferedReader(
                new InputStreamReader(url.openStream()));
           String inputLine;
           while ((inputLine = inStream.readLine()) != null)
           {
             out.println(inputLine);
           }
           inStream.close();
           System.err.println("inStream closed ...");
        }
        catch (MalformedURLException me)
        {
          System.err.println("MalformedURLException: " + me);
        }
        catch (IOException ioe)
        {
          System.err.println("IOException: " + ioe);
        }

    }
}

Here is the IOException that I get.
> IOException: java.io.FileNotFoundException:
http://sparc20:8080/examples/WEB-INF/servlets/CPP?inFile=inputFile
Please send some help my way.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to