Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Migrating from JSP to AngularJS moves page rendering from Spring MVC to the browser. Spring MVC continues to handle business operations and HTTP requests, but migrated controllers return data—normally JSON—instead of assembling a JSP view. The 2015 Spring example demonstrates this boundary and shows that both applications can be packaged in one WAR. AngularJS is now a legacy target: AngularJS documentation states, “AngularJS support has officially ended as of January 2022,” so assess security, browser compatibility, and a replacement plan before choosing it for new work.

What changes in the application boundary?

In a JSP application, a Spring MVC controller loads a model and returns a view name. The server resolves that view, evaluates JSP/JSTL tags, and sends completed HTML to the browser. In the AngularJS design, the browser application owns templates, binding, and screen state. Spring MVC exposes service endpoints that return resource data; AngularJS requests that data and renders the page.

Concern JSP-oriented application AngularJS client application
Rendering location Server renders JSP through Spring MVC. Browser renders AngularJS templates after requesting data.
Controller contract Controller populates a model and returns a view name or ModelAndView. Controller returns a resource representation, commonly JSON.
UI logic and binding JSP/JSTL tags and server-side model values. Client-side templates, scopes, directives, dependency injection, and binding.
Deployment boundary Web application serves JSP pages. Can be one WAR with a JSP entry page, or separately deployed frontend and backend; the 2015 example explicitly illustrates the one-WAR option.
Lifecycle Spring MVC and JSP support remain available in Spring Framework. AngularJS official support ended in January 2022.

Think of the UI and backend as two applications even when they share a repository and deployment artifact. That separation makes endpoint contracts, authorization, validation, error handling, and ownership explicit.

Plan the migration before changing controllers

Inventory each JSP route

  • Record the URL, controller method, JSP, included fragments, Spring form tags, JSTL logic, redirects, and session-dependent values.
  • Mark server-side validation, file uploads, authorization checks, and model attributes that the browser will need.
  • Identify shared layouts and navigation that may become AngularJS templates or components.

Choose an incremental boundary

You do not have to convert the whole application at once. Keep existing JSP routes working while introducing AngularJS for a bounded screen or workflow. A JSP can remain the entry page for the client application, while converted screens call JSON endpoints. This reduces the number of simultaneous changes and provides a rollback path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decide the deployment shape

The Spring.io example keeps client assets and the backend in one Java WAR and uses JSP for the index or entry page. This can simplify same-origin requests and operations, but it is an example rather than a universal prescription. Independent frontend and backend deployments can provide separate release cycles, yet require deliberate CORS, authentication, asset, and environment configuration.

Convert a page controller into a data endpoint

A typical JSP route returns a ModelAndView containing an owner identifier and other attributes. The AngularJS version exposes an endpoint for that owner and returns the owner resource. The exact mapping and payload depend on your domain; the 2015 article supplies the architectural direction, not a production API specification.

  1. Define the resource. Decide which fields the screen may read, which relationships are embedded or linked, and how missing records are represented.
  2. Map the endpoint. Use a Spring MVC request mapping that identifies the resource, such as an owner identifier, and return a response body serialized as JSON.
  3. Move authorization to the service boundary. Check the authenticated principal and access policy for every request; do not rely on the former JSP navigation or hidden fields.
  4. Preserve validation and error semantics. Specify status codes and a stable error body for invalid input, unauthenticated requests, forbidden operations, and missing resources.
  5. Keep domain work out of the view layer. The endpoint should call the application/service layer just as the former page controller did, while omitting presentation-only model assembly.

For example, the old flow is “request page → controller builds model → JSP renders.” The new flow is “request application shell → AngularJS calls owner endpoint → Spring MVC returns JSON → AngularJS binds the response.” Do not treat this conceptual sequence as a complete contract for versioning, authentication, pagination, or caching; design those for your application.

Keep JSP safely during coexistence

Spring MVC still supports JSP and JSTL through InternalResourceViewResolver. Spring’s documentation recommends placing JSP files under WEB-INF so clients cannot request them directly: Spring JSP and JSTL reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure the resolver to map logical view names to that protected directory, and leave unconverted controllers returning those view names. When several view resolvers are configured, Spring notes that InternalResourceViewResolver should be last: for JSPs it may determine whether a resource exists only by dispatching through RequestDispatcher, so an earlier resolver should get the opportunity to resolve other view types first (Spring view-resolution reference).

Typical coexistence checks

  • Place JSP files beneath WEB-INF and verify direct URL requests are rejected.
  • Keep legacy view names distinct from API paths, for example /owners/page versus /api/owners/{id}.
  • Ensure security rules cover both the old page routes and new endpoints.
  • Test redirects, sessions, CSRF protection, and content types separately for HTML and JSON requests.

Build the AngularJS side around the endpoint contract

Entry page and assets

Serve an HTML entry page that loads the AngularJS application and its templates. In the one-WAR arrangement shown by Spring.io, that entry page may itself be a JSP, while static JavaScript and CSS are packaged with the web application. Avoid putting authorization decisions in the entry page; the API must enforce them.

Data loading and binding

Have the AngularJS controller or service request the endpoint, expose loading and error states, and bind only the fields defined by the contract. Convert server validation messages into accessible field or form errors rather than assuming every response is a successful page model.

Testing

Test the endpoint independently with authenticated and unauthorized requests, invalid identifiers, and malformed input. Test the AngularJS unit and UI behavior with successful, empty, slow, and failed responses. The AngularJS-era features described in the original example—scopes, directives, templates, dependency injection, and UI testing—explain the client-side model, but they do not replace contract and security tests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose a rollout strategy

Route-by-route replacement

Convert one complete workflow, including its endpoint, authorization, UI, tests, and monitoring. Leave unrelated JSP routes untouched. This is usually the least disruptive approach for a large application.

Shared shell with staged screens

Introduce the AngularJS shell and migrate screens behind it one at a time. This can provide consistent navigation, but requires careful handling of browser history, deep links, session expiry, and fallback routes.

Separate frontend deployment

Build and deploy the client independently when release cadence or scaling requires it. Configure the API’s allowed origins, cookie or token policy, CSRF model, static asset hosting, and environment-specific endpoint URLs explicitly. Do not assume that a configuration valid inside one WAR remains valid across origins.

AngularJS lifecycle risk in 2026

The AngularJS documentation says, “AngularJS support has officially ended as of January 2022” (AngularJS Conceptual Overview). Therefore, AngularJS should generally be treated as a legacy constraint or an intermediate modernization step, not the default framework for a new application. If an existing organization must use it, document who will maintain dependencies, how browser and security issues will be handled, and what migration or replacement trigger will end the investment. The support notice establishes the lifecycle fact; the risk level for your system depends on its exposure, maintenance capacity, and replacement plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Migration checklist

  • Define the screen’s JSON resource and error contract before removing its JSP model.
  • Retain authorization, validation, auditing, and business rules on the server.
  • Put remaining JSPs under WEB-INF and order InternalResourceViewResolver last in a resolver chain.
  • Separate API routes from legacy page routes and test content types.
  • Choose one-WAR or independent deployment deliberately; neither is mandatory.
  • Add rollback, observability, and contract tests for each converted workflow.
  • Record AngularJS’s January 2022 end of official support and an exit plan.

The Bottom Line

The practical migration is not a JSP-to-template rewrite. It is a change in responsibility: AngularJS renders the browser UI, while Spring MVC supplies secured data services. Migrate incrementally, preserve JSP safely where needed, and treat AngularJS as legacy software because official support ended in January 2022.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.