File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes prob in getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "prob in getParameter" Watch "prob in getParameter" New topic
Author

prob in getParameter

Sophia Choi
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
The problem is I can't receive the value of path or other parameters.
Some parameters are in JSP and passed to Servlet. I use request.getParameter("path"). But, it doesn't work.
Any idea? thanks.
String path="c:\\test\\";
form name="form1" enctype="multipart/form-data" method="post"
onSubmit="return validateForm(this)" action="/cfhc/servlet/UploadTest"
input type=hidden name=path value="<%=path%>"
input type=submit name=upload value="upload" size=25
--------------
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException,IOException{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
String path = req.getParameter("path"); //set default upload directory
Prasanth Allam
Greenhorn

Joined: Oct 10, 2003
Posts: 2
In case the request is a multi-part request the request cannot be accessed directly. There is a package in Struts which has been taken from Oreily through which you can access the multi-part request data
[ March 03, 2004: Message edited by: Prasanth Allam ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prob in getParameter
 
Similar Threads
How to read a input type file in servlet and display the contents of a file in servlet
Browse file and get path on another page
getting null values for parameters
how do i get value from input type file in servlet?
the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is