How to execute CGI Programs in Tomcat Server

Hi,
I am working on executing Perl Scrtipts(or CGI programs) in Tomcat Server.
I have downloaded ActivePerl 5.8.0 6.0.3 build.I have modified some .jar files in tomcat\server\lib.
I have changed conf\web.xml to access the CGIServlet.class that is in servlets-cgi.jar.
My example.cgi is
#!c:\Perl\bin\perl.exe
print
"Content-type: text/plain\n\n";
foreach $var (
sort keys %ENV) {
print
"$var=\"$ENV{$var}\"\n";
@values = split(
/&/,$ENV{'QUERY_STRING'});
foreach $i (@values) {
($varname, $mydata) = split(
/=/,$i);
print "$varname = $mydata\n";
and my test.html is
<HTML>
     <HEAD>
          <TITLE>Environment Variables using GET</TITLE>
     </HEAD>
     <BODY>
          <FORM ACTION="cgi-bin/example.cgi" METHOD="POST">
               Press submit for a list of environment variables. <BR>
               First Name: <input type="text" name="fname" size=30><p>
               Last Name: <input type="text" name="lname" size=30><p>
               <input type="submit">
          </FORM>
     </BODY>
</HTML>
here I have changed url mapping in web.xml to cgi-bin.
The test.html produces two text fields first and last name on submit:
it accesses:http://localhost:8080/smalltownpapers/cgi-bin/example.cgi?fname=Tim&lname=Eden
this should print some environmental variables but it is producing an empty page.
Tomcat is not showing any errors or Tomcat is not at all listening.
Can any one help me to solve this and how to execute Perl scripts in Tomcat server
Thanks,
Regards
Murthy

Sorry, I've never done this. I went to the Tomcat site and pulled down the CGI docs, which you might have seen:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cgi-howto.html
No other help available from me. Sorry.

Similar Messages

  • How do set operation timeout in tomcat server?

    hi all
    suppose i have one endless loop program(jsp) that program run under tomcat server,
    so it's keep on runing in tomcat server.
    i want, after some time the server send error message like operation timeout.
    how do set operation timeout in tomcat server?
    if anybody know help me.
    my mail id [email protected]

    Well, the server.xml file has connection time outs, but that is for idle time, I think... I'm not sure what would happen in a loop... , especially if you are sending some data back to the client in each iteration. Generally you shouldn't be starting a loop that will really run forever. Maybe have some type of counter to break out if something hasn't occurred within x iterations, or create a separate thread that can sleep for x seconds and set a flag to break the loop after that time.

  • How to run Java program as Daemon Server in linux

    How to run Java program as Daemon Server in linux
    i would like to run the java program on system start up in a redhat linux system
    can any one provide rc.status file

    http://wrapper.tanukisoftware.org/

  • How to display BIRT report on Tomcat server

    Hi,
    I am using BIRT to generates the report, i am having a BIRT file called Customers.rptdesign that i want to execute on Tomcat server, but not able to execute. On eclipse brouser its running very well and displaying reports in brouser but not in Tomcat.
    Waiting for replies........

    Well all you have to there is deploy the report with webapplication and write your custom classes which would compile the report and gives a HTML/PDF/RTF..... response for you accordingly.
    please checkout the below link which gives an idea of how you can do that....
    http://www.onjava.com/pub/a/onjava/2006/07/26/deploying-birt.html?page=2*
    and here is an example of a Dynamic Servlet which could be configured accordingly to generate proper response for you accordingly by passing (Mapped) parameters to the report.
    http://wiki.eclipse.org/Java-DynamicReport_Servlet_(BIRT)_*
    and to get more insight information about how this framework creeps in and how is that we use its API and etc..
    You may have a look at the below article
    http://www.eclipsecon.org/summiteurope2006/presentations/ESE2006BIRT_The_Open_Source_Reporting_Framework.pdf_*
    Hope this might help :)
    REGARDS,
    RaHuL

  • How to execute external program in java?

    My question is how to execute an external program in java.
    I need to call a unix command in java.
    Thanks.

    it depends on what you are trying to do. Following are the two methods
    1. Runtime.exec() : this method allows you just to call an external program as a seperate process
    2. JNI (Native Interface) :- As of right now only C and C++ are supported by this method. This method allows you to directly call the C/C++ methods from JAVA

  • How to execute java programs in xcode

    I cannot execute Java program in XCode for Mountain Lion 10.8.2. Please help me how to execute a Java program.

    Do you have a particular error or message or diagnostic or issue, or something that's particularly wrong with Xcode?  If installed, Java does work, and Java applications can be invoked.
    Background: Java was deprecated from OS X a while back, and Java itself was removed from the default OS X 10.8 installation.
    Given that Java is now an add-on for OS X, you'll want to check with Oracle — the owner of Java — for OS X kits and tools.
    I don't know off-hand if Xcode still particularly supports Java (it was pretty weak, when last I checked), but I'd expect you'll be using makefiles for the work, and I'd also suspect that whatever Java support remains in Xcode will probably be going away in some future version of Xcode.   (If support hasn't already disappeared.  You may be using bash build scripts and makefiles to deal with Java now, or going forward.)
    If you don't have access to the Apple developer forums and the discussions of tools available there, then the archives of the Apple Java-Dev mailing list can be a good spot to look for existing discussions, and to post questions related to Java development on OS X.
    As for IDEs other than Xcode,  Eclipse or NetBeans or IntelliJ IDEA, and BlueJ all run on OS X, and any of these would probably be a better long-term choices for Java development on OS X.

  • How to execute modulepool program

    hi all,
    how to execute programming type M
    plz send detail informaton regarding that one

    Hi
    You cannot execute a Module pool program as you execute other ABAP programs.
    For executing a Module pool program, <b>create a z-transaction code</b> for that M-program
    & then execute the z-transaction code.
    Goto Transaction <b>SE93</b> to create a z-transaction code for that m-program.
    Then execute the Z-Transaction code.
    Kindly reward points for helpful answers!
    Best regards,
    Thangesh

  • How to execute  a program  from another

    Hi, expert
    Sorry for this question, but how can I do to execute a program from another with no parameter.
    I will thanks an answer, it's urgent...
    Regardss,
    mgg
    P.D. Points rewarded.

    Simple,  use the SUBMIT statement.
    SUBMIT zreport and return.
    Regards,
    RIch HEilman

  • How to use toplink in the tomcat server?

    Hi,
    I want to use Toplink in the tomcat server. I am connecting to oracle database using DataSource.
    Can any body help me, what are the setup required to use the toplink in the tomcat?
    Please help me if any body has idea on the same.

    Take a look at this other forum posting: Tomcat acquire dataSource [TOPLINK-7060]
    --Shaun                                                                                                                                                                                                                               

  • How to attach a file to tomcat server using SERVLETS

    Hello friends,
    I want to enable users to attach a file and send it to my server. This is a very common feature seen anywhere like e-mail attachments.
    Iam using tomcat server. I tried HTTP put but it did not work.
    Please give some suggessions.
    Thanks
    Goldy

    check this url:
    http://www.servlets.com/cos/index.html
    follow the link MultiPartRequest
    Spieler

  • How to solve Ajax problem in Tomcat server

    we are using Tomcat 5.0.27 server and my sql server. we using AJAX Techniques in my projects. but its some times working fine but sometimes not working the code sample is given by
    var req;
    var names;
    function initRequest(url) {
    if (window.XMLHttpRequest)
         req = new XMLHttpRequest();
    else if (window.ActiveXObject)
    isIE = true;
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req==null)
              alert("Your browser does not support XMLHTTP.")
    function loadPurchase(startLetter)
         var mon=document.getElementById('month').value;
    var yea=document.getElementById('year').value;
    var url = "../inventory?actionS=INVPurchase&month="+escape(mon)+"&year="+escape(yea)+"&id="+escape(startLetter);;
         initRequest(url);
         req.onreadystatechange = PurchaseRequest;
         req.open("GET", url, true);
         req.send(null);
    function PurchaseRequest() {
              0 (Uninitialized) The object has been created, but not initialized (the open method has not been called).
              1 (Open) The object has been created, but the send method has not been called.
              2 (Sent) The send method has been called, but the status and headers are not yet available.
              3 (Receiving) Some data has been received.
              4 (Loaded) All the data has been received, and is available
    alert(re.readyState)
         if(req.readyState == 4)
    alert("Inside Ready State");
    document.getElementById('Edit').disabled=true;
    document.getElementById('Delete').disabled=true;
    if (req.status == 200)
    PurchaseMessages();
         else
              alert("Problem retrieving XML data")
    function PurchaseMessages()
    var batchs = req.responseXML.getElementsByTagName("purchases")[0];
    var str="";
    for(loop = 0; loop < batchs.childNodes.length; loop++)
    var batch = batchs.childNodes[loop];
    var Refid = batch.getElementsByTagName("Refid")[0];
    str = str +Refid .childNodes[0].nodeValue;
    var tb=document.getElementById('PurchaseTable');
    tb.innerHTML=str ;
    the alert coding( req.readyState) is always 1
    how to solve for that
    please any one help me

    Sorry, I've never done this. I went to the Tomcat site and pulled down the CGI docs, which you might have seen:
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cgi-howto.html
    No other help available from me. Sorry.

  • How to execute Java program in Solaris 8 (Intel Platform).

    Hello All,
    I have installed Solaris 8 on my Intel based PC. JDk 1.1 and JDK 1.2 is installed by default. When I compile any Java applet or Application, it successfull complies but when I try run that applet or application (java Appletname or applicationname), It gives the error message .... File not found...Check whether file exist in the directory or not.
    Can someone tell me the reason of this error and how to correct it. Where to set the CLASSPATh etc. under Solaris 8 for successful compilation and run of programs. I do not have any problem under Windows/2000.
    Thanks in advance,
    Amoid

    [amoyeed],
    Hello All,
    I have installed Solaris 8 on my Intel based PC. JDk
    1.1 and JDK 1.2 is installed by default. When I
    compile any Java applet or Application, it successfull
    compliesI will assume that you executed this command:
    #javac <java source code filename>.java
    In order to find out which version of the javac you are using to compile the program, execute the following:
    #/usr/bin/which javac
    The output will tell the exact path to the javac binary file.
    but when I try run that applet or application
    (java Appletname or applicationname), It gives the
    error message .... File not found...Check whether file
    exist in the directory or not.You probably have not set the current directory to your environment variable PATH for the Unix shell that you are using.
    You can do the following:
    #java ./<standalone application or applet name>
    Can someone tell me the reason of this error and how
    to correct it. Where to set the CLASSPATh etc. under
    Solaris 8 for successful compilation and run of
    programs.In the shell environment settings file. Which Unix shell are you using? Bourne, Korn or C?
    I do not have any problem under Windows/2000.
    Thanks in advance,
    AmoidHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • How to execute sapscript programe in SAP

    hi
    i created sapscript programe i want to execute how can i do it please help me
    thanks in advanced.

    Hi,
    two ways.
    1. Simply by executing program by F8 and giving values in selection screen. You have used FMs like open_form and write_form and close_form etc. hence form will be called
    2. Form and print program will be assigned to output type in NACE transaction.
    Now this will be called when via standard transaction like VA03 -> print option and set output type
    at this time based on output type print progral will be called.
    *Hope this may give you a bit of idea.

  • Plz help me how to execute jsms program

    hi,
    i hv downloaded jsms package, in that i hv total source code for sending and receiving msgs, but i am unable to do run that application, cany any one tell me how can i run that program,
    i hv already configure required jar and properties files into my java folder, now how can i execute that application.

    What is JSMS? It's not part of Sun's distributions.

  • Executing a program when the server starts

    I have developed a chat program and to run it I have type "java ChatManager".
    Is there a way where this program can start automatically when I start the tomcat.
    Regards,
    Sharad

    The chat application is a java file. I need to keep it running so that I can use it in my applet. The problem is after I start the tomcat, I have start the chat application and for this I open a new window and type "java ChatManager". Once this is done I can start using the chat applet. Is there a way, where the chat application starts automatically when the tomcat starts. Do I need to add something in the server.xml file for this.
    Regards,
    Sharad

Maybe you are looking for