I thought I was getting the hang of JSP syntax, but I just don't know what's wrong here. I have a select drop-down thingie in my HTML that looks like this:
I have the form going back to the same page, and at the top I have the following JSP code:
It keeps printing out "method is null", and I don't know why! Obviously, I want it to say something like "method is ImportAddressesAuto", but I don't understand why the parameter is not getting set, or being reset to null. Thanks for your help!
Ugh! I was making a new page by copying an old one and modifying it, and that old one was for uploading a file, and I even though I had changed the form action, I hadn't paid attention to the rest of the form tag, and was telling it the enctype was MULTIPART/FORM-DATA!
Originally posted by dragon ji: Hi,all I can't get parameter in url if set enctype='MULTIPART/FORM-DATA' in <form>, why? How can I get it?
You will not get the parameters with usual request.getParameter method if the enctype is set to 'MULTIPART/FORM-DATA' . Are you uising this to upload a file. Wherever you are trying to retrieive this parameter first create a MultipartRequest object and then do it For Example: MultipartRequest mutlipartrequest = new MultipartRequest(request,path,5*1024); String name = multipartrequest.getParameter("name"); Hope this helps. Sona.