Skip to content

Instantly share code, notes, and snippets.

@SylvainMarty
SylvainMarty / spring-enable-history-mode.md
Created December 3, 2017 09:21
Code snippet to enable "HTML5 history mode" in Spring MVC

Spring MVC - Enable HTML5 history mode

This snippet shows how to authorize HTML5 history mode used by Javascript frameworks like Angular or VueJS.

There is two simple steps :

  • Create the filter
  • Register it in your project configuration

Create the filter

Create the file HistoryModeFilter.java with the following content :