tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Kukulies <k...@gilberto.physik.rwth-aachen.de>
Subject OT: java programming Q
Date Wed, 10 May 2000 14:04:31 GMT

The more I'm playing with servlets the more I like it and the more
I'm moving the CGI program parts to servlets.

But for efficiency reasons there's a lot I'd still prefer to be done with CGI
programs (C programs).

One thing I found when I tried to concentrate several buttons in
an ACTION=/servlets/Some which should dispatch dependent on the button
pressed.

As long as I stay in Java, everything is fine.

Now I want to exec my CGI-C program and the whole CGI context gets lost,
even the outputstream.

I'm using java.lang.Runtime exec() for this.

Is there a way to let the exec'ed process inherit the environment?
Don't know how this could be achieved but writing everything
in Java would be too much for the moment.

E.g:

public void doGet (HttpServletRequest request,
                   HttpServletResponse response)  
        throws ServletException, IOException
        {
         String type =  request.getParameter("type");
         if(type.compareTo("Reportausgabe")==0){
                  out.println("Reportausgabe");
                  try {
                   out.println("executing...");
                   action="/usr/local/www/cgi-bin/test.sh";
                   runner.exec(action);
                  } catch(Exception e) { 
                      out.println("EXEC error");
                      out.flush();
                      e.printStackTrace();
                    }
                  return;
            }


You can also email me directly if this pollutes the list.

-- 
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de

Mime
View raw message