You can't read the file upload parameter using  request.getParameter(). You
will need to use a file upload library class such as Jason Hunter's found
on servlets.com. to read uploaded files. Having a file upload parameter in
your form is causing the problems with reading the other parameters too.
Get the library and use its methods to extract the form values.

Regards,

Richard

At 11:33 PM 6/27/2002 -0700, you wrote:
>Guys,
>
>Check the following code.
>
>
>
>Collecting Three Parameters
>
>
>
>First Parameter:
>Second Parameter:
>Third Parameter:
>
>The servlet code is
>
>
>import java.io.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>
>public class trial extends HttpServlet {
>
>  public void service(HttpServletRequest request,HttpServletResponse
> response) throws ServletException, IOException {
>
>   response.setContentType("text/html");
>   PrintWriter out = response.getWriter();
>   String title = "Reading Three Request Parameters";
>
>   out.println("FirstParam: " + request.getParameter("attached_file"));
>   out.println("\n SecondParam: " + request.getParameter("param2"));
>   out.println("\n ThirdParam: " + request.getParameter("param3"));
>
>}
>
>}
>
>The problem is that
>
>System.out.println(request.getParameter("attached_file"));
>
>System.out.println(request.getParameter("param2"));
>
>System.out.println(request.getParameter("param3")); are all printling null
>even if I fill these fields. Any idea???
>
>Jamshed
>
>
>
>---------------------------------
>Do You Yahoo!?
>Sign-up for Video Highlights of 2002 FIFA World Cup
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to