Programming Books

Main Menu

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions

Programming Books

Header Banner

Programming Books

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions
Java programming
Home›Java programming›Web framework: Javalin 4.0 supports JDK 16 and Kotlin 1.5

Web framework: Javalin 4.0 supports JDK 16 and Kotlin 1.5

By Brandy J. Richardson
September 14, 2021
0
0


The Javalin open source web framework is available in version 4.0. More than two years have passed since the previous major version Javalin 3.0, and therefore a lot has happened within the framework of Java and Kotlin – among others, all Javalin modules with language versions Java 16 and Kotlin 1.5 can now be used.

Syntax updates

In version 4.0, the syntax for path parameters changed from :param To {param} amended. The syntax is also new which allows forward slashes in path parameters. A single path segment can now contain both static and dynamic parts as well as multiple path parameters, as shown in the version 3 migration guide:

get("/:param", ...) // old
get("/{param}", ...) // new

get("/:param-suffix", ...) // invalid
get("/{param}-suffix", ...) // new

get("/files/:filename.:extension", ...) // invalid
get("/files/{filename}.{extension}", ...) // new

get("/root/:subpaths/leaf") // old (will only match /root/1/leaf)
get("/root//leaf") // new (will match /root/1/2/3/leaf)

Javalin 4.0 is also revising the configuration options for static file options. By removing the global options, these can now be added through the static file manager and can be configured in a known way in Javalin:

config.addStaticFiles(staticFiles -> {
    staticFiles.aliasCheck = ContextHandler.AliasCheck((path, resource) -> !path.endsWith(".txt"));
    staticFiles.directory = "src/test/external/";
    staticFiles.location = Location.EXTERNAL;
});

Another new feature of version 4.0 is the test module javalin-testtools, advanced customization options for the Validatorclass as well as the replacement of JavalinJson through a JsonMapper-Interface with four optional methods.

Lightweight and multilingual

Javalin is said to be lightweight and stands out from similar frameworks by being designed for Java and Kotlin interoperability rather than offering different versions for programming languages. In addition, Javalin supports the OpenAPI specification since version 3.0 using a plug-in.

The Javalin home page provides an introduction to both official and community tutorials. According to the development team, the open source framework has around 130,000 monthly downloads.

More information on Javalin 4.0 can be found in a blog post.


(May)


Related posts:

  1. Go from zero to hero as a professional Java programmer for $ 30
  2. The Great Learning Academy has seen its user base increase by 5 times
  3. How to Become a Software Engineer: A Complete Guide
  4. Python 3.10 runs switch equivalent, adds more help if something goes wrong • DEVCLASS
Tagsprogramming languages

Archives

  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • January 2021
  • December 2019
  • November 2019
  • October 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2017

Categories

  • C++ programming
  • Java programming
  • Php programming
  • Phyton programming
  • Programming industry

Recent Posts

  • 12-bit dual-channel PCIe card samples at 2x 3.2 Gsample/s
  • Woster: Need work for those stifled by student loans – Mitchell Republic
  • How to Become a Cloud Engineer
  • [Unveil]Emerging indie band SURL wants to bring rock back to the masses
  • Ansible vs. Puppet | Compare DevOps tools
  • Privacy Policy
  • Terms and Conditions