Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

getting null values for parameters

 
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
 
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
 
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
 
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
 
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.
 
What a show! What atmosphere! What fun! What a tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic