You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sheba Tasaduque <sh...@yahoo.com> on 2003/08/29 00:47:09 UTC

need help in apache tomcat 4.0

hi
================ERROR========================
v:http://localhost:8080/examples/servlet/UploadServlet (fetch post)
E: Event error.badfetch:line13:java.io.FileNotFoundException: http://localhost:8080/examples/servlet/UploadServlet
==========================================================
I want to ask about correct path for addition in apache tomcat 4.0.Actaully i want to get sound file through servlet and for this i have downloaded the class, MultipartRequest, written by Jason Hunter which is available for download at http://www.servlets.com/cos/index.html.you can read Complete documentation for the class at http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html.
After downloading now i am facing problem of placing the classes and etc.I have downloaded cos-05Nov2002.zip and in this zip i got classes folder+doc folder+src folder+upload.war+cos.jar.
now i dont understand where i put these things in apache tomact 4.0 and jdk1.3.0_02.IN jdk1.3 i have putted servlet.jar+cos.jar in jre\lib\ext\.through this i have successfully compiled my servlet but now after putting the class files of servlets in apache tomcat\webapps\examples\web-inf\classes whenever i submit record file from recordmessege  to Uploadmessege then i m getting error of file not found as given above.
=================recordmessege.java===============
initial code 
-------------------
-------------------
<submit next=\"http://localhost:8080/examples/servlet/UploadServlet\" enctype=\"multipart/form-data\"  namelist=\"messege\" method=\"post\" />
-----------
---------------
and from net i got following submit but i dont know about that upload.cgi thats why i have putted 
http://localhost:8080/examples/servlet/UploadServlet.
               <submit src="upload.cgi" namelist="recording"
                 method="post" enctype="multipart/form-data"/>
          
================UploadServlet.java=======================
import javax.servlet.*; 
import javax.servlet.http.*; 
import java.io.*; 
import com.oreilly.servlet.MultipartRequest;
public class UploadServlet extends HttpServlet { 
     public void doPost(HttpServletRequest req, HttpServletResponse res) 
          throws ServletException, IOException 
     { 
          // Get output stream. 
          ServletOutputStream out = res.getOutputStream(); 
          // establish directory in which to save recordings and 
               5MB upload limit 
          MultipartRequest multi = new MultipartRequest(req,"/recordings/", 5242880); 
          // Send a response back to VXML client. 
          res.setContentType("text/xml"); 
          out.println("<?xml version=\"1.0\"?>"); 
          out.println("<vxml version=\"1.0\"><form><block>");
          out.println("<prompt>Your greeting was saved.</prompt><exit/></block></form></vxml>"); 
          out.flush(); 
          out.close(); 
     }
}
=========================================
Regard
SHEBA TASADUQUE
n


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: need help in apache tomcat 4.0

Posted by John Turner <to...@johnturner.com>.
This describes exactly where you should put files:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/index.html

And you also might find the ClassLoader HOWTO helpful:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

John

sheba Tasaduque wrote:

> hi
> ================ERROR========================
> v:http://localhost:8080/examples/servlet/UploadServlet (fetch post)
> E: Event error.badfetch:line13:java.io.FileNotFoundException: http://localhost:8080/examples/servlet/UploadServlet
> ==========================================================
> I want to ask about correct path for addition in apache tomcat 4.0.Actaully i want to get sound file through servlet and for this i have downloaded the class, MultipartRequest, written by Jason Hunter which is available for download at http://www.servlets.com/cos/index.html.you can read Complete documentation for the class at http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html.
> After downloading now i am facing problem of placing the classes and etc.I have downloaded cos-05Nov2002.zip and in this zip i got classes folder+doc folder+src folder+upload.war+cos.jar.
> now i dont understand where i put these things in apache tomact 4.0 and jdk1.3.0_02.IN jdk1.3 i have putted servlet.jar+cos.jar in jre\lib\ext\.through this i have successfully compiled my servlet but now after putting the class files of servlets in apache tomcat\webapps\examples\web-inf\classes whenever i submit record file from recordmessege  to Uploadmessege then i m getting error of file not found as given above.
> =================recordmessege.java===============
> initial code 
> -------------------
> -------------------
> <submit next=\"http://localhost:8080/examples/servlet/UploadServlet\" enctype=\"multipart/form-data\"  namelist=\"messege\" method=\"post\" />
> -----------
> ---------------
> and from net i got following submit but i dont know about that upload.cgi thats why i have putted 
> http://localhost:8080/examples/servlet/UploadServlet.
>                <submit src="upload.cgi" namelist="recording"
>                  method="post" enctype="multipart/form-data"/>
>           
> ================UploadServlet.java=======================
> import javax.servlet.*; 
> import javax.servlet.http.*; 
> import java.io.*; 
> import com.oreilly.servlet.MultipartRequest;
> public class UploadServlet extends HttpServlet { 
>      public void doPost(HttpServletRequest req, HttpServletResponse res) 
>           throws ServletException, IOException 
>      { 
>           // Get output stream. 
>           ServletOutputStream out = res.getOutputStream(); 
>           // establish directory in which to save recordings and 
>                5MB upload limit 
>           MultipartRequest multi = new MultipartRequest(req,"/recordings/", 5242880); 
>           // Send a response back to VXML client. 
>           res.setContentType("text/xml"); 
>           out.println("<?xml version=\"1.0\"?>"); 
>           out.println("<vxml version=\"1.0\"><form><block>");
>           out.println("<prompt>Your greeting was saved.</prompt><exit/></block></form></vxml>"); 
>           out.flush(); 
>           out.close(); 
>      }
> }
> =========================================
> Regard
> SHEBA TASADUQUE
> n
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software