All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sterl.spring.persistent_tasks_ui.SpringPersistentTasksUIConfig Maven / Gradle / Ivy

There is a newer version: 1.5.3
Show newest version
package org.sterl.spring.persistent_tasks_ui;

import java.util.concurrent.TimeUnit;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpringPersistentTasksUIConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/task-ui").setViewName("/task-ui/index.html");
        //registry.addRedirectViewController("/task-ui/", "/task-ui");
    }
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/task-ui/assets/**") 
            .addResourceLocations("classpath:/static/task-ui/assets/") 
            .setCacheControl(CacheControl.maxAge(90, TimeUnit.DAYS));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy