Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getting null values for parameters  RSS feed

 
sanj singh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii,
Because ur request values are encripted, so u couldn't get the request parameters values.
Regards,
Kalaiselvan.S
 
sanj singh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kalaiselvan
Thanks for your reply.But how do I get the value of the parameters.
regards
sanj
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"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
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!