Skip to content

Simple non-Spring Boot Spring MVC application demonstrates a usage of virtual threads

Notifications You must be signed in to change notification settings

eager-zh/non-spring-boot-mvc-application-with-virtual-threads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

non-spring-boot-mvc-application-with-virtual-threads

This is a small POC to illustrate a discussion on StackOverflow question Virtual Threads in Spring MVC in Non-Spring Boot Application.

The WAR file of this Spring MVC application should be deployed to a servlet container/web server. If Tomcat is used, then to execute Spring servlet/Controllers on virtual threads the Connector element of Tomcat server.xml file should be configured to use virtual threads:

<Connector ...
           useVirtualThreads="true" /> 

The project also demonstrates unrelated to servlet container/web server usage of virtual threads in Spring Beans asynchronous methods, annotated with @Async.

An example of Spring MVC application has been adapted from Spring MVC Example tutorial.

To test deploy the WAR file to your servlet container/web server and point a browser to http://localhost:8080/home.

Java 21 or later is required.

About

Simple non-Spring Boot Spring MVC application demonstrates a usage of virtual threads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages