• 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(),doPost(),do Trace(),doOption()

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Please can anyone help me in understanding these methods of servlets,by giving any sample coding for all the methods.

Please..

Thanks in advance
Regards,
Prathana
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope, but there is some useful information here.
 
prathana balaji
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thanks for the information,it is totally theoretical,I can very well understand the concepts,but I don't how to implement it.So I just want some example code/programs to under the implementation of the servlet methods.

Thanks & regards,
Prathana
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
doGet()

doPost()

doTrace()


The final example is left to the reader.

Seriously thought, each gets called and responds with information to the client. In theory they could all do the same thing, but in practice only Get and Post are really used, and what they return is a matter of best practice rather than anything else.

Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you would like more information on the difference between Get and Post, you should see the thread here

Dave
 
prathana balaji
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi dave,

I tried the code which you have send for doTrace()
I am getting the below error in browser,can you please help me

HTTP Status 405 - HTTP method GET is not supported by this URL

--------------------------------------------------------------------------------

type Status report

message HTTP method GET is not supported by this URL

description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).


--------------------------------------------------------------------------------

Sun Java System Application Server Platform Edition 9.0_01

Regards,
Prathana
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I tried the code which you have send for doTrace()
I am getting the below error in browser,can you please help me

HTTP Status 405 - HTTP method GET is not supported by this URL


If the servlet only implements doTrace then it can only be accessed using the HTTP TRACE method. That means you can't use an HTML link (which uses GET), and HTML form (which uses GET or POST) or type the address into the browser manually (which would use GET). You'll need to use an HTTP client library like Apache Commons HttpClient, or write some JavaScript code using XmlHttpRequest (which can generate all HTTP methods).
reply
    Bookmark Topic Watch Topic
  • New Topic