↗ JetBrains 20% discount
Buy any product from JetBrains and get a 20% discount.
Spring MVC
import org.springframework.beans.factory.annotation.Autowired;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.format.FormatterRegistry;import org.springframework.web.servlet.config.annotation.EnableWebMvc;import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;@EnableWebMvc@Configuration@ComponentScanpublic class TradeConfig implements WebMvcConfigurer { @Autowired private TradeService tradeService; @Override public void configureViewResolvers(ViewResolverRegistry registry) { registry.jsp("/WEB-INF/views/", ".jsp"); } @Override public void addFormatters(FormatterRegistry registry) { registry.addConverter(new TradeIdToTradeConverter(tradeService)); }}