File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getting null values for parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "getting null values for parameters" Watch "getting null values for parameters" New topic
Author

getting null values for parameters

sanj singh
Ranch Hand

Joined: Jun 30, 2001
Posts: 129
Hi All
I am playing around with the O'reilly file upload package.here is my html file
<html>
<body>
<form enctype="multipart/form-data" action="servlet/UploadServlet" method="POST" >
Enter name of the School:
<input type="text" name="name"><br>
Select a file to Upload:
<input type="file" name="fileToUpload">
<input type="submit" value="UPLOAD MY FILE">
</form>
</body>
</html>

When the request is sent to the servlet the values returned for the two parameters is null.
Anybody knows why?
regards
sanj
Kalaiselvan Selvamani
Ranch Hand

Joined: Sep 10, 2001
Posts: 32
Hii,
Because ur request values are encripted, so u couldn't get the request parameters values.
Regards,
Kalaiselvan.S
sanj singh
Ranch Hand

Joined: Jun 30, 2001
Posts: 129
Hi kalaiselvan
Thanks for your reply.But how do I get the value of the parameters.
regards
sanj
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

"kalaiselvan"
your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
Sanja,
Once, I faced same problem.
I got around it by changing the action of the form.
e.g. If action is www.xyz.com,
change it to www.xyz.com?input1=value1&input2=value2.
You have to write a javascript (onSubmit).
Regards
-Deep Narsay


SCJP2
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I've used the cos file upload package with no problems. My form contains regular fields, and up to 4 file upload fields.

you don't post any code, so I'm not sure if posting mine would help you out.. perhaps you could email me offline and I can help you debug.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting null values for parameters
 
Similar Threads
upload servlet
How to upload a file using servlets to a webserver
the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is
file upload from servlet
file upload problem