• 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

doGet() vs doPost()

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an HTML form (Welcome.html).
On submitting the form, I call goGet() of servletA.
doGet() of servletA displays another form (Data) and calls doPost() to service the request enetred in this form.
Afetr completeion of the request, control returns to doGet() and once again displays form (Data).
And so on...
Will I need doGet() and doPost() both or can just 1 method take care of everything?
If I want to print say an Array of integers got by processing form Data,
how would I display it in HTML using the servlet?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To display array of integers u first convert each integer into String & insert it i html
for e.g 's'(for e.g. s="11") is string containing integer value then u have to write
out.print("<html><body>"+s+"</body></html> ;
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic