Solved

request.getParameter is returning null value

Posted on 2008-10-26
1
899 Views
Last Modified: 2010-05-18
Hi

My code: request.getParameter is returning null value

String Name = request.getParameter("txtName");

Name = null


<form name="form1" method="post" action="fire" enctype="multipart/form-data">
<input type="text" name="txtName" value="">
<input type="file" name="image1">
<INPUT type="image" src="/update.gif">

Open in new window

0
Comment
Question by:techques
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

by:
rrz earned 50 total points
ID: 22809707
You should use the org.apache.commons.fileupload   API for  a multipart form.
Here is an example.
http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q_23504709.html
For your here, you could use something like  
                 
  boolean isMultipart = ServletFileUpload.isMultipartContent(request);
  if(isMultipart){
                  ServletFileUpload upload = new ServletFileUpload();
                  FileItemIterator iter = upload.getItemIterator(request);
                  FileItemStream item = null;
                  String name = "";
                  InputStream stream = null;
                  while (iter.hasNext()){
                                         item = iter.next();
                                         name = item.getFieldName();
                                         stream = item.openStream();
                    if(item.isFormField()){
                        if{"txtName".equals(name){
                                out.println("txtName is" + Streams.asString(stream) + "<br/>");
                        }
                    }

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question