doGet and doPost in Servlets

0 votes
When to use doGet() and doPost() methods?
Jul 17, 2018 in Java by Decoder
• 120 points
724 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,190 points
197 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,190 points
64 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,040 points
301 views
0 votes
1 answer

difference between wait() and sleep() in java

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

answered Apr 25, 2018 in Java by developer_1
• 3,280 points
51 views
0 votes
1 answer

Difference between JSF, Servlet and JSP?

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

answered Jul 2, 2018 in Java by samarth295
• 2,190 points
222 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,540 points
787 views
0 votes
1 answer

Get parameters from the URL with JSP

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

answered May 28, 2018 in Java by parth295
• 4,600 points
380 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,840 points
62 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 25, 2018 in Java by Mrunal
• 680 points
136 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,040 points
93 views