aspose 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


Win a copy of Spring in Action this week in the Spring forum!
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: prob in getParameter