-
1. Re: deploy .jar files in JBoss-2.4.4_Tomcat-3.2.3
niaz May 22, 2002 8:01 PM (in response to ggregd)JBOSS_DIST/lib/ext should work. If this is an application specific jar file then you can also deploy it within your application's WEB-INF/lib directory.
-
2. Re: deploy .jar files in JBoss-2.4.4_Tomcat-3.2.3
ggregd May 23, 2002 6:00 PM (in response to ggregd)Got it, thanks. I don't know why I thought it wasn't working, but now I have a new problem...
I'm trying to set up file upload. My form and servlet are essentially copies of the O'Reilly example. on submit I'm getting:
Error: 405
Location: /evoucher/FileUpload
HTTP method GET is not supported by this URL
which confuses me because there is no GET method, only POST.
----- form -----
What is your name?
Which file do you want to upload?
---- servlet ----
package cc.nisc.servlet;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oreilly.servlet.MultipartRequest;
public class FileUpload extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
try {
MultipartRequest multi = new MultipartRequest(req,
"/resources/uploads", 1024 * 1024);
out.println("");
out.println("Employee Self Serve File
Upload/HEAD>");
out.println("");
out.println("<H1>File Upload</H1>");
out.println("<H3>File Information:</H3>");
out.println("");
Enumeration params = multi.getParameterNames();
while (params.hasMoreElements()) {
String name = (String)params.nextElement();
String value = multi.getParameter(name);
out.println(name + " = " + value);
}
out.println("");
out.println("<H3>Files:</H3>");
out.println("");
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);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f != null) {
out.println("length: " + f.length());
}
out.println();
}
out.println("");
}
catch (Exception e) {
out.println("");
e.printStackTrace(out);
out.println("");
}
out.println("");
}
}