Amy Hafer

+ Follow
since Mar 29, 2001
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amy Hafer

I was trying to find some example of a slider bar with 2 number inputs on the same bar. For example, if you have 3 ranges: 0-100 and 101-200 and 201+, I would like to let the user change the ranges by inputting say, 150 and 250 so you now have 0-150, 151-249 and 250 to some maximum. I see that the rich faces has a slider bar very similar to what I was hoping to find however it just has the one number input. Can anyone give me some pointers on how to accomplish this?

16 years ago
Hi James, you are probably right that it is the way I am constructing the zip file but ZipEntry is a string so I can't use getPath there. I am guessing the problem might be in this part of the code so for the sake of brevity (and clarity) here is the try statement where I am getting the HttpServletRequest called request and passing it to the ListFilez class and getting back the Vector (the list of files). Since it does work for the directory I originally start the search in but not for the subdirectory is definitely does sound like I need to use the getPath or getAbsolutePath method. Thank you for all your help so far!

**Actually I just realized that the problem is with the ListFiles class. The way it is written, the Vector is returned empty if the only file it is looking for is in the subdirectory. If it is looking for 2 files, one in the parent directory and one in the subdirectory, it will only return the file in the parent directory. So I am doing something wrong with how or where I created the Vector.
[This message has been edited by Amy Hafer (edited September 10, 2001).]
22 years ago
Thanks James. I am trying it this way now. Do you have to do anything special with the file besides using the addElement(files(i)) method when you are putting the files in a Vector and sending it to a zip stream? For some reason, the file is not being found in the subdirectory (or maybe it is, it is just not being sent to the zip file).
22 years ago
I have a servlet that takes HttpServlet requests (shapeName), finds those files in a directory on the server, and zips them up in a file for HttpServlet response. Problem is now I have files in subdirectories and I don't know how to recursively search through the subdirectories. The code is one class with an annonymous inner class, FilenameFilter. I could use suggestions on how best to do the recursion within the listFiles method as coded and add the files directly to the File[] theShapes. Hoping that creation of a new class to recurse through the directory is not necessary. Thanks!

[This message has been edited by Amy Hafer (edited August 09, 2001).]
22 years ago
In my case, reading and then writing the fileinputstream actually dumps a bunch of binary characters from the file to a new html page with a URL of the location of the servlet.
Has anyone else experienced this problem??
22 years ago
I am new to this site but it is by far the most user friendly I have been to. Hoping you can help..
I am writing a servlet that sends a zip file to the user of some files that he/she requested. I am able to create the zip file and write the correct entries to it on the server but all that is available for download is an empty zip file. I think I have major problems understanding output streams.
I was using the
ServletOutputStream out=response.getOutputStream();
I have also tried
PrintWriter out = new PrintWriter(response.getOutputStream());
then I thought all you need is to start the response:
response.setHeader("Content-Disposition","attachment;filename=" + thefile.getName());
but I don't know how to take the ZipOutputStream or is it the FileOutputStream and send it via out.println()
Any help would be most appreciated!!!
22 years ago