Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spring boot MVC config

@EnableWebMvc
@Configuration
public class WebConfig implements WebMvcConfigurer {

   @Override
   public void addViewControllers(ViewControllerRegistry registry) {
      registry.addViewController("/").setViewName("index");
   }

   @Bean
   public ViewResolver viewResolver() {
      InternalResourceViewResolver bean = new InternalResourceViewResolver();

      bean.setViewClass(JstlView.class);
      bean.setPrefix("/WEB-INF/view/");
      bean.setSuffix(".jsp");

      return bean;
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: Could not determine java version from 
Java :: raise error java 
Java :: java basic syntax 
Java :: java suppresswarnings unchecked 
Java :: java input string with spaces 
Java :: sort comparator in java 
Java :: java append a string to file 
Java :: java display message 
Java :: flink prometheus alert on failed jobs 
Java :: jsonArray to list in java 
Java :: java turn string into int 
Java :: declare array with size java 
Java :: what is maven artifact 
Java :: volley android 
Java :: System.out.println("Hello world") 
Java :: what is inflater in android 
Java :: How to efficiently reverse a singly linked list, in Java? 
Java :: how to add the last area of an array in java 
Java :: java get filename without extension 
Java :: jmeter get var 
Java :: Conversion from Java List to Array 
Java :: Java Create an OutputStream 
Java :: java try with resources 
Java :: phone number format java 
Java :: from file to array java 
Java :: java super keyword 
Java :: debug in java 
Java :: wait method in java 
Java :: Array List java can I add a pair of element 
Java :: android view set padding programmatically 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =