aspose file tools*
The moose likes Servlets and the fly likes why can't  use request.getParameter when jsp form's enctype is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "why can Watch "why can New topic
Author

why can't use request.getParameter when jsp form's enctype is "multipart/form-data"

alex han
Ranch Hand

Joined: Dec 13, 2002
Posts: 46
i use oreilly's com.oreilly.servlet.MultipartRequest for upload file ,and the code was write in a struts action:

in a jsp,the code is:



now i need refresh that jsp,because there is a "select" in jsp,when use "select",a javascript function was invoke.
and the code is :


i need use request.getParameter in this jsp,so i can remeber what i have selected last time..
how can i use request.getParameter when there is enctype in form.
because if there is enctype in form ,request.getParameter always return null.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
http://www.coderanch.com/t/355356/Servlets/java/Servlets-HTML-forms-multipart-form


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
alex han
Ranch Hand

Joined: Dec 13, 2002
Posts: 46
thanks.but now i only want to know,when i use enctype="multipart/form-data" in jsp. how can i get the value that should return by request.getParameter
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
If you'r eusing a 3rd-party library for the parsing, it usually has methods to get the parameters. If you're doing it yourself, it's tricky but doable. I did it with my upload web-app FileNabber - http://fn.filenabber.com

You should be able to look at the source of any of the 3rd-party libraries and see how they did it.

brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why can't use request.getParameter when jsp form's enctype is "multipart/form-data"
 
Similar Threads
Problem using oreilly,multipart-request with Websphere 5.1
GET and POST Method
multipart/form-data inputs
help: getParameter returning null!
how do i get value from input type file in servlet?