Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:13:54+00:00 2026-05-25T11:13:54+00:00

I had been reading on servlets and all books deal with invoking a servlet

  • 0

I had been reading on servlets and all books deal with invoking a servlet by means of a form (POST requests).
I was wondering if there are other means to invoke a servlet by a client.

Here is my understanding: For POST requests to a servlet, we use a link thus making a GET request on that servlet and in the servlet we need to call doPost() from doGet().

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:13:54+00:00Added an answer on May 25, 2026 at 11:13 am

    You can write a client that creates GET and POST HTTP messages and invoke a servlet. However you can use the Apache Commons HTTP Client to do that.

    Also, from your question you seem to thin that all Servlets handle GET requests via a POST request. That is incorrect. The reason it is done in the servlet you viewed is because the servlet does that same thing for both GET and POST request. So to minimize the amount of duplicate code it is so written.

    UPDATE: It seems Apache Commons HTTP Client is now end of life, and is no longer being developed. It has been replaced by the Apache HttpComponents project in its HttpClient and HttpCore modules, which offer better performance and more flexibility.

    UPDATE2: I took your original question as “How can we invoke servlets other than from the browser”. Well, a browser is just a client that efficiently and easily lets us make GET and POST requests to a server [in our case a Servlet]. We can also write a Java proram to make GET and POST request to our Servlet, but that will be tedious and cumbersome. So, we can use the libraries specified above to do that. These libraries are not limited to client Java prorams and can be used from any application that can invoke Java code [and that includes JSP].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've never had to deal with PCI compliance before. I've been reading their documentation
All text field values in my database had been converted to upper case. I
I have been reading a lot about how flash development/design had died, and as
I've been reading about TransactionScope and had a question about its interoperability with ADO.Net
I had been reading a webpage on Image Compression (Lossy and Non-lossy) . Now
I'm new to this level of PHP programming and I've been reading a post
I had been reading a few articles on some sites about Formatted and Unformatted
This is my first post even though I've been reading SO for a while.
I've been reading the solutions from others who've had this problem and most answers
I've been reading and watching videos on nested forms, but I haven't had any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.