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?
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
Joined: Jul 31, 2008
Posts: 120
posted
0
[ October 02, 2008: Message edited by: yuvraj kotegar ] [ October 02, 2008: Message edited by: yuvraj kotegar ]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
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
Joined: Jul 31, 2008
Posts: 120
posted
0
because i tried the same above programe with doPost it did'nt work why??
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.