RE: Multipart/form-data
I posted a similar message regarding the Oreilly upload package, contacted the author of the package, Mr. Jason Hunter, and also did a lot of experiment of my own. The conclusion is this is MAYBE a problem between mod_jk and apache. Here are the results of my investigation: somebody in this list claims tomcat3.1+apache+mod_jserv works; J. Hunter said tomcat alone works for him; I tried tomcat3.2+mod_jk+apache1.3.14, failed for binary files, worked only for text file; I also tried different clients on different environment, made sure this is not a client issue; I ported my application to JRun, it works fine without modification; Yanbin |+ || Randy Layman | || randy.layman@aswe| || think.com| ||| || 01/12/01 07:28 AM | || Please respond to | || tomcat-user | ||| |+ ---| | | | To: "'[EMAIL PROTECTED]'" | | [EMAIL PROTECTED]| | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: RE: Multipart/form-data| ---| An Internal Server Error is caused by an uncaught exception in your code. Probably a NullPointerException, but it could be anything that extends java.lang.Runtime exception. Randy -Original Message- From: Saikat Chatterjee [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 12:44 AM To: [EMAIL PROTECTED] Subject: Multipart/form-data Hello, I have encountered a problem regarding 'multipart/form-data' encryption type in a html FORM. I have written a servlet through which an user uploads file. I am expecting that the content type coming to the servlet will be of type 'multipart/form-data' . To handle this particular type of data i am using the MultipartRequest parser provided by Oreilly. But everytime i am running the servlet, i am getting a 'Internal Server Error'. Why this is so?Is it due to the fact that Tomcat cannot handle the 'multipart/form-data'? I am using Apache 1.3.12 as webserver and Tomcat 3.2 as servlet container. Any help will be highly appreciated. Thanks, Saikat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Multipart/form-data
Thanks, this is exactly where the problem is. I just switched my application from ajp13 to ajp12, it works fine with uploading both binary and text files. I never thought it could be the connector problem on the tomcat side. Can somebody tell me where to find all the known problems of tomcat, please? Yanbin |+--- || "Ed Gomolka" | || egomolka@aus| || info.com| || | || 01/12/01 | || 10:52 AM | || Please | || respond to | || tomcat-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: RE: Multipart/form-data| ---| If you're using mod_jk with binary multipart/form-data, avoid AJP13, as it has a bug. Use AJP12. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 9:11 AM To: [EMAIL PROTECTED] Subject: RE: Multipart/form-data I posted a similar message regarding the Oreilly upload package, contacted the author of the package, Mr. Jason Hunter, and also did a lot of experiment of my own. The conclusion is this is MAYBE a problem between mod_jk and apache. Here are the results of my investigation: somebody in this list claims tomcat3.1+apache+mod_jserv works; J. Hunter said tomcat alone works for him; I tried tomcat3.2+mod_jk+apache1.3.14, failed for binary files, worked only for text file; I also tried different clients on different environment, made sure this is not a client issue; I ported my application to JRun, it works fine without modification; Yanbin |+ || Randy Layman | || randy.layman@aswe| || think.com| ||| || 01/12/01 07:28 AM | || Please respond to | || tomcat-user | ||| |+ - --| | | | To: "'[EMAIL PROTECTED]'" | | [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES) | | Subject: RE: Multipart/form-data | - --| An Internal Server Error is caused by an uncaught exception in your code. Probably a NullPointerException, but it could be anything that extends java.lang.Runtime exception. Randy -Original Message- From: Saikat Chatterjee [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 12:44 AM To: [EMAIL PROTECTED] Subject: Multipart/form-data Hello, I have encountered a problem regarding 'multipart/form-data' encryption type in a html FORM. I have written a servlet through which an user uploads file. I am expecting that the content type coming to the servlet will be of type 'multipart/form-data' . To handle this particular type of data i am using the MultipartRequest parser provided by Oreilly. But everytime i am running the servlet, i am getting a 'Internal Server Error'. Why this is so?Is it due to the fact that Tomcat cannot handle the 'multipart/form-data'? I am using Apache 1.3.12 as webserver and Tomcat 3.2 as servlet container. Any help will be highly appreciated. Thanks, Saikat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Problem with Tomcat as NT service
I never tried to run tomcat as a service, but the same thing happened to me before. So I hope the following will help: I had a servlet class which also has a main() function for dos-console testing. I found that I have to use different jdbc driver to open the same Access datasource. The reason, as I later found out, you have to setup the classpath correctly in both cases so that tomcat can find the proper driver. I suspect this could be the reason of your problem. As I understand, the environment variables can be seen by a service can be different from those by a regular windows program. The reason behind that involves more of the Windows OS system knowledge. But I suggest you try to print out the necessary class path or other related environment variables in both cases. Hope it helps. Ma, Yanbin |+--- || Vinod| || Vinod@essemm| || .co.in | || | || 01/03/01 | || 06:47 AM | || Please | || respond to | || tomcat-user | || | |+--- ---| | | | To: | | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: Problem with Tomcat as NT service | ---| Hi, I have jakarta-tomcat-3.2 running on Win NT4 and IIS. I have used jk_nt_service.exe to make tomcat as NT service and followed the steps as it is in the documentation. After that I have started the service, when I run a small jdbc example I got the sql exception 'No suitable jdbc driver found'. The same program runs fine when I start tomcat manually. Please provide solution. Thanx n Regards, Vinod - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Asking for your kind Help
You can download tomcat for IIS from www.apache.org. Look for Jakarta project then tomcat. Ma, Yanbin |+--- || "hlhuang"| || hlhuang@fzu.| || edu.cn | || | || 12/05/00 | || 03:19 AM | || Please | || respond to | || tomcat-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: Asking for your kind Help | ---| Hello I am a student from China.I'd like to get some information about Tomcat Running on Win32 platform.I am expect someone can give me answers to the following questions: Where can I download the Tomcat patch for Microsoft Internet Information Server(IIS4.0 or later)? Tomcat supports Windows 2000? Thank you! yours sincerely huanglei
RE: file upload servlet
I am very surprised. I tried the same version. Here is the code I am using. As you can see, (or somebody can see), this is from upload.war (the sample came with the multirequest class) with some modifications. If everything works ok, I should be able to see all the parameters and files listed. However, it only worked for text files. For binary files, results vary from server error to exception in the MultiPartRequest constrcutor. The only difference I could find between your code and mine is mine is in a servlet's doPost() function? Now I am really confused. Help! Is it related to tomcat somehow. I am using tomcat 3.2.1 with apache 1.3.14 on WinNT4.0. Yanbin try { MultipartRequest multi = new MultipartRequest(req, "D:/upload"); writer.println("PParams:/P"); Enumeration params = multi.getParameterNames(); while (params.hasMoreElements()) { String name = (String)params.nextElement(); String value = multi.getParameter(name); writer.println("p" + name + " = " + value + "/P"); } writer.println(); writer.println("pFiles:/p"); Enumeration files = multi.getFileNames(); while (files.hasMoreElements()) { String name = (String)files.nextElement(); String filename = multi.getFilesystemName(name); String type = multi.getContentType(name); File f = multi.getFile(name); writer.println("p" + "name: " + name + "/p"); writer.println("p" + "filename: " + filename + "/p"); writer.println("p" + "type: " + type + "/p"); if (f != null) { writer.println("p" + "f.toString(): " + f.toString() + "/p"); writer.println("p" + "f.getName(): " + f.getName() + "/p"); writer.println("p" + "f.exists(): " + f.exists() + "/p"); writer.println("p" + "f.length(): " + f.length() + "/p"); writer.println("p/p"); } } } catch (IOException lEx) { this.getServletContext().log("error reading or saving file" + lEx, lEx); } catch (Exception e) { this.getServletContext().log("caught un-known exception" + e, e); } |+ || Tim Cronin| || [EMAIL PROTECTED]| || eClub.com| ||| || 12/27/00 06:47 PM | || Please respond to | || tomcat-user | ||| |+ ---| | | | To: "'[EMAIL PROTECTED]'" | | [EMAIL PROTECTED]| | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: RE: file upload servlet| ---| I was able to upload text, image, exe files, and other binaries with oreily package. I am using the nov 20 2000 version here's the code from my jsp file private String processRequest ( HttpServletRequest request ) { String cType = request.getContentType(); if (cType != null cType.toLowerCase().startsWith("multipart/form-data")) { try { String appPath = getPath(request); MultipartRequest multi = new MultipartRequest(request, appPath); String submit = multi.getParameter(SUBMIT_UPLOAD_NAME); if(submit != null (submit.equals(SUBMIT_UPLOAD_VAL))) { Enumeration files = multi.getFileNames(); if(!files.hasMoreElements()) { return("No file was uploaded!"); } else { return("uploaded " + multi.getFilesystemName((String)files.nextElement()) + " to " + appPath); } } } catch(IOException e) { return(e.getMessage()); } } return(""); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 27, 2000 5:37 PM To: [EMAIL PROTECTED] Subject: RE: file upload servlet Thank you, Tim. I tried this one first before I posted the message. It worked only for text files. I tried two versions. The very first and the very last one. Did you work with this library before? How did you upload binary files? Yanbin |+ || Tim Cronin| || [EMAIL PROTECTED]| || eClub.com| ||| ||
servlet mapping
Hi, I recently moved from tomcat 3.1 to tomcat 3.2.1. I found the speed of start-up/shutdown is improved dramatically, and I don't have to manually kill my apache and restart it anymore. However, with the upgrade, I found something else strange happened. I defined the following servlet so that whenever the user navigates to my web application, it will automatically invoke my servlet to generate a welcome page for him. For instance, http://myserver.com:8080/myapp will invoke the PWFrontPageServlet. It worked well with 3.1. However, it does not work in 3.2.1. I have to manually type in http://myserver.com:8080/myapp/index.html to invoke the servlet. I tried to set the welcome-file-list element in web.xml, it didn't work. Can somebody please help me out? Ma, Yanbin = servlet definition servlet servlet-namePWFrontPageServlet/servlet-name servlet-classPWFrontPageServlet/servlet-class /servlet servlet-mapping servlet-namePWFrontPageServlet/servlet-name url-pattern/index.html/url-pattern /servlet-mapping =
Re: Windows Tomcat DOS Console Error View
you can change the properties of the shortcut that you use to invoke the tomcat. |+--- || "z z"| || zazzex@hotma| || il.com | || | || 12/20/00 | || 12:20 PM | || Please | || respond to | || tomcat-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: Windows Tomcat DOS Console Error View | ---| I get errors and messages on TOMCAT DOS CONSOLE. It's only 25 line max console and can't scroll up. I know I can extend to 50 lines in property but it doesn't work on spot. How can I extend it to 50 lines? Or is there anyway better to see entire scrolled up lines? Please include this email [EMAIL PROTECTED] in Cc: or Bcc: in your reply. Thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: Deny web-inf access (security problem)
I am surprised this could happen, you must use a customized configuration file. Usually, the default conf file generated by tomcat contains at least something like this for your web-inf folder. You may want to add this to your conf file or web configurations somewhere. (depending on the server you use) Location "/admin/WEB-INF/" AllowOverride None deny from all /Location Ma, Yanbin |+--- || Paul Gonin | || [EMAIL PROTECTED]| || o.edu | || | || 12/19/00 | || 02:02 PM | || Please | || respond to | || tomcat-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Yanbin Ma/SYS/NYTIMES)| | Subject: Deny web-inf access (security problem) | ---| Hi, I have a JSP that uses a bean. It uses the following directory structure : webapps/myapply/myapply.jsp webapps/myapply/web-inf/classes/mybean.class It works fine but I am annoyed that people can download the bean directly and "access" its content because it contains critical information (passwords). How do I protect my bean and more generraly I'd like to protect the whole web-inf directory (if it's possible) Note : I'm using Tomcat standalone. Thanks
tomcat_apache.conf tomcat.conf
Hi, I started using tomcat with Apache recently. I am confused by tomcat.conf and tomcat_apache.conf. According to the User's Guide, tomcat_apache.conf is automatically generated by tomcat. So I will have to: 1) include tomcat_apache.conf at the end of Apache's httpd.conf. 2) start tomcat first, so that tomcat_apache.conf can be generated. However, on another section of the User's Guide named "Making Apache Serve your Context's Static Files", I'm instructed to add something to the tomcat.conf so that tomcat will leave static files for Apache to process. So my questions: How are tomcat.conf and tomcat_apache.conf used by tomcat? Especially, in what order does tomcat read these two files? Can somebody help me out, please? Ma, Yanbin