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

  • Home
  • SEARCH
  • 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 8566769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:43:54+00:00 2026-06-11T17:43:54+00:00

I need to create 5 methods on the server side, which will work with

  • 0

I need to create 5 methods on the server side, which will work with binary data. The remote clients are applet and JavaScript. The Client will send files to the server, and the server must parse these files and then return the response as XML/JSON.

So I am confused – is it good practice to use REST-service in this case? Or should I use a servlet?

My colleague told me:

“Creating REST-service that will be used only by one Application isn’t
good. REST must be created only when it will be used by many apps. And
REST has some disadvantages over servlet: REST is slower than servlet;
it more difficult to write thread-safe REST than servlet”

However, I see some disadvantages with using Servlet: I need to send a function name that I want to call (i.e. as extra HTTP parameter send function name)
and then inside the doPost method perform the following switch:

switch(functionName) {
 case "function1":
   function1(); 
   break;
 case "function2"
   function2(); 
   break;
//.... more `case` statements....

}

In case of REST I can simple use different URLs for different functions.
Also, in the case of REST, it more convenient to return JSON/XML from server.

  • 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-06-11T17:43:55+00:00Added an answer on June 11, 2026 at 5:43 pm

    Well,
    I wouldn’t agree with your colleagues’ opinion that isn’t good to have rest used by only one application, since you may decide in the future to have different applications using the same rest api. If I were you I would choose the pure REST. Why?

    1. If you’re using some framework for rest implementation (let’s say apache cxf or jersey) you get lots of stuff out of the box – you write POJO you get a rest, you get serialization and deserialization, to and from let’s say, JSON object out of the box (eventually you will need to implement some JsonProviders but this is not a big deal).

    2. It is intuitive to work (if you design your rest APIs well).

    3. Very easily consumable by JavaScript clients (especially if you’re using JQuery or something like that)

    However, it strongly depends of what exactly do you want to do, if you have some strong transactional logic, the rest could be quite tricky. If you’re only going to do POST requests (without using the other HTTP methods) you might want to use the Servlet since you won’t have to work with additional frameworks and making more dependencies. Note that the REST is more or less an architectural concept and it does not contradict with the Servlet technology, if you’re stubborn enough you can make a rest api only with servlets :-).
    Hope I’ve helped.

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

Sidebar

Related Questions

I want to create client-server GPS tracking application that clients send location data to
I am building a client side application that will use a SQL Server back
I'm trying to log client's exceptions on the server side. So I need to
I am getting response from server side in the form of json array.I need
I've got the following problem; I need to create a method, which generates a
I am trying to create a ValidationAttribute (for Remote validation which only works on
I have a client, which communicates to a TCP server. I store a username/password
on my server i've got an xml file for each client which holds the
We are using a WCF Data Service to broker our data server side, and
i need to write an ajax applicatoin, where on the server side (implemented in

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.