doGet and doPost in Servlets

0 votes
When to use doGet() and doPost() methods?
Jul 17, 2018 in Java by Decoder
• 120 points
5,445 views

1 answer to this question.

0 votes
When you are using HTTP GET requests then you should use doGet() method whereas for HTTP POST requests, doPost() method is used. HTTP GET requests are idempotent whereas the HTTP POST requests are not idempotent. If an end-user has submitted POST form then the data will not get reflected into the URL but for GET form, the data will get reflected in the URL.
answered Jul 17, 2018 by Mrunal
• 680 points

Related Questions In Java

+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,220 points
3,617 views
0 votes
2 answers

How can I create File and write data in it using Java?

import java.io.BufferedWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class WriteFiles{ ...READ MORE

answered Jul 26, 2018 in Java by samarth295
• 2,220 points
2,960 views
0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,140 points
4,128 views
0 votes
1 answer

difference between wait() and sleep() in java

We can find a big difference between ...READ MORE

answered Apr 26, 2018 in Java by developer_1
• 3,350 points
1,255 views
0 votes
1 answer

Difference between JSF, Servlet and JSP?

Servlet - it's java server side layer. JSP ...READ MORE

answered Jul 3, 2018 in Java by samarth295
• 2,220 points
1,560 views
0 votes
1 answer

Importing classes in JSP

Use Page Directive to import a Class ...READ MORE

answered May 25, 2018 in Java by Rishabh
• 3,620 points
28,050 views
0 votes
1 answer

Get parameters from the URL with JSP

To delete the subject record with its ...READ MORE

answered May 29, 2018 in Java by Parth
• 4,640 points
3,403 views
0 votes
1 answer

How can we upload the files using JSP/ Servlets in Java?

<form action="upload" method="post" enctype="multipart/form-data"> ...READ MORE

answered Jun 8, 2018 in Java by Sushmita
• 6,920 points
888 views
0 votes
1 answer

What is the difference between getPath(), getAbsolutePath() and getCanonicalPath() in Java?

getPath() - returns a String which denotes the ...READ MORE

answered Jul 26, 2018 in Java by Mrunal
• 680 points
1,937 views
0 votes
5 answers

How to compare Strings in Java?

String fooString1 = new String("foo"); String fooString2 = ...READ MORE

answered Jul 12, 2018 in Java by Daisy
• 8,140 points
2,576 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP