• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UPLOAD IMAGE and OTHER DATA

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am creating an Input form where the user can enter details like say Company detials. Also in that form I want to accept his company logo, ie an image.
Now only on one single Submit, I want to send both these details to the servlet.
I have a seperate servelt for uploading image and another servelt for accpeting the other Company detials.
But as the Image requries multipart encoding...how do i combine both the details and call the respective servlets...on One single SUBMIT button.
If not this way..pls suggest some other way of doing it.
Thanks.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My own thought is that it is generally bad practice to have a single Form submission handled by more than one servlet.

By saying "I have one 'servlet' to handle image uploads", you mean you have a chunk of java code that handles multi-part file uploads, then make this a simple java class instead, and use it within the other servlet.
 
I've been selected to go to the moon! All thanks to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic