• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

can we use post method in urlrewriting?

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can we use the post method???

if yes what is the reason?
[ October 02, 2008: Message edited by: Bear Bibeault ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
URL rewriting is used for URLs that get sent from the server to the client, whereas POST is a way to transfer data from the client to the server. So the two don't intersect. Can you clarify what you mean?
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i mean suppose say you have a small program ie servlet can you write a doPost method in it instead of doGet??
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


[ October 02, 2008: Message edited by: yuvraj kotegar ]
[ October 02, 2008: Message edited by: yuvraj kotegar ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
doGet and doPost are for handling client requests; you can have either or both in a servlet, depending on how it is used. But what do those methods have to do with URL rewriting?
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
because i tried the same above programe with doPost it did'nt work why??
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Didn't work"?
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did not work...

[ October 02, 2008: Message edited by: yuvraj kotegar ]
[ October 02, 2008: Message edited by: yuvraj kotegar ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Bear meant was "what exactly did you try, and how exactly did it not work?" TellTheDetails
 
Author
Posts: 3473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sample doGet & doPost



Do you have a form element to test your post


 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yuvraj your sample code has only a doGet() method. Now if a HTTP request uses GET, your code will work fine. But if a POST is used, it will fail, since your servlet does not support it.
Refer to arulk's code for a sample implementation of both doGet() and doPost().

Along with the servlet, if you have the security constraints in your DD,then the DD must also support both these methods.


Hope this helps
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic