content: /**
   * Copyright (c) 2010-present Abixen Systems. All rights reserved.
   *
   * This library is free software; you can redistribute it and/or modify it under
   * the terms of the GNU Lesser General Public License as published by the Free
   * Software Foundation; either version 2.1 of the License, or (at your option)
   * any later version.
   *
   * This library is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
   * details.
   */
  
  package com.abixen.platform.client.web.configuration;
  
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.config.annotation.*;
  import org.springframework.web.servlet.view.InternalResourceViewResolver;
  import org.springframework.web.servlet.view.JstlView;
  
  
  @EnableWebMvc
  @Configuration
  @ComponentScan("com.abixen.platform.client.web")
  public class PlatformWebClientConfiguration implements WebMvcConfigurer {
  
  
      private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
              "classpath:/META-INF/resources/", "classpath:/resources/",
              "classpath:/static/", "classpath:/public/" };
  
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS);
      }
  
  
      @Override
      public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
          configurer.enable();
      }
  
      @Bean
      public InternalResourceViewResolver jspViewResolver() {
          InternalResourceViewResolver jspViewResolver = new InternalResourceViewResolver();
          jspViewResolver.setViewClass(JstlView.class);
          jspViewResolver.setPrefix("/WEB-INF/jsp/");
          jspViewResolver.setSuffix(".jsp");
          return jspViewResolver;
      }
  
  
  }
  