Scrivio Interview library
DesignIntermediate5 min read · updated 12 November 2026

A team must choose between Jakarta REST and Spring MVC for new services in a Spring Boot organisation. What do you consider?

In a Spring Boot organisation, Spring MVC is usually the better choice because it integrates directly with Spring Security, Bean Validation, Actuator metrics and test support such as MockMvc, and it is what the platform and most engineers already know. Jakarta REST is a standard API that is portable across application servers and MicroProfile runtimes, which matters only if we really expect to run on those platforms, and mixing both in one organisation raises support and knowledge costs, so I would choose the standard the platform team supports unless portability is a real need.

Why this question is asked

Both Spring MVC and Jakarta REST can build the same REST endpoints, and inside Spring Boot both work. So the choice is rarely about features of the API itself; it is about everything around it: security, metrics, testing, documentation, hiring and who supports it at 3 a.m. Interviewers ask this design question to see whether we can look beyond annotations to the cost of a decision across many teams. In this answer, we will recap the two options, compare their integration with the rest of Spring Boot, weigh the value of portability honestly, look at the cost of running both, and finish with a decision rule and an example.

1A Quick Recap of the Two Options

Spring MVC is Spring's own web framework. Controllers are classes annotated @RestController with methods annotated @GetMapping and similar, and the DispatcherServlet routes requests to them. It comes with spring-boot-starter-web (spring-boot-starter-webmvc in Boot 4; check your version).

Jakarta REST, also called JAX-RS, is the Jakarta EE standard. Resources use @Path, @GET and @Produces, and an implementation such as Jersey or RESTEasy routes requests. In Spring Boot it runs through spring-boot-starter-jersey. The same API runs on WildFly, Open Liberty, Payara and in Quarkus and Helidon.

Java
// Spring MVC
@RestController @RequestMapping("/orders")
class OrderController {
@GetMapping("/{id}") Order get(@PathVariable long id) { return service.find(id); }
}
// Jakarta REST
@Path("/orders")
class OrderResource {
@GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON)
Order get(@PathParam("id") long id) { return service.find(id); }
}

For a simple endpoint the code is almost the same. The differences appear in the parts around the endpoint.

2How Each Integrates With Spring Boot

Spring MVC is the center of Spring Boot's web support, so everything connects without extra work. Spring Security's request matchers and method security are designed around it. @Valid on a request body triggers Bean Validation and produces a 400 with field errors through Spring's exception handling. @ControllerAdvice and ProblemDetail give consistent error responses. Actuator records http.server.requests metrics with the URI template as a tag, which keeps dashboards readable. MockMvc and @WebMvcTest let us test a controller slice quickly without starting a server, and Spring REST Docs and springdoc-openapi document the API.

Jersey in Spring Boot works, and Boot provides metrics for it too, but it is the less travelled path. Security still applies at the filter level, but some integrations are thinner, there is no @WebMvcTest equivalent, so tests usually start a server, and most examples, Stack Overflow answers and internal guides assume Spring MVC. Each gap is small; together they slow teams down.

Spring MVC and Jakarta REST in a Spring Boot organisation
ConcernSpring MVCJakarta REST (Jersey)
Security integrationFirst-classWorks at filter level
Validation and error bodies@Valid, @ControllerAdvice, ProblemDetailBean Validation, ExceptionMapper
MetricsActuator http.server.requestsSupported, less common
Slice tests@WebMvcTest with MockMvcStart a server, or Jersey test kit
PortabilitySpring onlyApp servers, MicroProfile, Quarkus
Team familiarityUsually highUsually lower

3How Much Is Portability Worth?

The main argument for Jakarta REST is that it is a standard: the same resource classes can move from Spring Boot to Open Liberty, Quarkus or a Jakarta EE server. That is real value in some situations, for example a company that sells software customers deploy on their own application servers, or an organisation moving from Spring to Quarkus for native images.

But we should be honest about how often that happens. A service rarely moves frameworks, and when it does, the REST layer is the easy part; configuration, persistence, security and tests take most of the effort. So portability of the REST annotations alone is worth little unless the rest of the stack is also portable. If the organisation is committed to Spring Boot, choosing Jakarta REST for portability means paying the integration cost every day for a benefit that may never be used.

4The Cost of Mixing Both

The worst outcome is often not the wrong choice but two choices. With some services on Spring MVC and others on Jersey, the platform team maintains two sets of security filters, metric dashboards, error formats and starter libraries. Engineers moving between teams relearn the basics. Incident responders need to know two request pipelines. A shared library such as a company authentication starter has to support both, doubling its testing.

Suppose an organisation runs 60 services, 50 on Spring MVC and 10 on Jersey. Every platform change, such as a new tracing header or a security patch to request handling, needs two implementations and two rollouts. That cost, paid every quarter, usually outweighs any technical advantage of the minority choice.

5A Decision Rule and an Example

My rule is to choose the standard the platform team supports, which in a Spring Boot organisation is Spring MVC, and use Jakarta REST only when portability is a concrete requirement with a named target, such as a product that must run on customers' Jakarta EE servers or a planned move to a MicroProfile runtime. Existing Jersey services do not need an urgent rewrite; they move when they are significantly reworked.

Step throughChoosing the REST API for a new service
  1. Must it run outside Spring Boot?Named target: app server, Quarkus
    YesJakarta RESTNoContinue
  2. Platform supports Jakarta REST?Starters, dashboards, docs
    YesEither works; prefer platform defaultNoSpring MVC
  3. Spring MVCDefault for Spring Boot organisations
  4. Record the decisionShort ADR with the reason

4 steps in order. Play them, or step through them one at a time.

Portability must be a real requirement to outweigh platform support.

6Follow-up questions

Can Spring MVC and Jersey run in the same application?

Yes. Jersey can be registered as a filter or a servlet alongside the DispatcherServlet with different paths. It is useful during a migration, but it doubles the request handling paths in one process, so it should be temporary.

What if a team already knows Jakarta REST well from an application server background?

Their knowledge transfers quickly, because the concepts are the same. I would still use Spring MVC for consistency with the platform, and the learning curve is usually a few days. The long-term cost of an outlier service is higher than the short-term cost of learning new annotations.

Does the choice affect performance?

Not meaningfully for typical services. Both are thin layers over the servlet container, and request time is dominated by database and downstream calls. Performance is not a good reason to choose either one.

7Conclusion

In this answer, we saw that inside a Spring Boot organisation Spring MVC wins on integration with Spring Security, validation, Actuator metrics and slice testing with MockMvc, while Jakarta REST wins on portability across application servers and MicroProfile runtimes. Portability is worth paying for only when it is a concrete requirement, and running both multiplies support and knowledge costs, so the default should be whatever the platform team supports.

What to say in the interviewAbout 80 seconds aloud

Open with

For simple endpoints the code is almost identical, so I would decide on everything around it. In a Spring Boot organisation, Spring MVC is the integrated path: Spring Security, @Valid with consistent error responses through ControllerAdvice and ProblemDetail, Actuator request metrics with readable URI tags, @WebMvcTest and MockMvc for fast controller tests, plus springdoc for documentation.

Then, if they want more

It is also what most engineers and internal guides already know. Jakarta REST's real advantage is that it is a standard, so the resources run on Jakarta EE servers, MicroProfile runtimes and Quarkus. That matters if we ship software customers deploy on their own servers or we are actually planning to move off Spring.

Otherwise portability of the REST annotations is worth little, because moving a service involves much more than the REST layer. I would also warn against mixing: if some services use Jersey and others Spring MVC, the platform team maintains two security setups, two metric dashboards and two error formats, and every platform change is done twice.

So my rule is to use the standard the platform team supports, Spring MVC here, unless a team can name a concrete portability requirement, and record that decision in a short ADR.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Jakarta EE specifications
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A team must choose between Jakarta REST and Spring MVC for new services in a Spring Boot...": https://scrivio-interview-library.netlify.app/java/jakarta-ee-platform/6b1b346aef/