File tree Expand file tree Collapse file tree 4 files changed +7
-68
lines changed
Expand file tree Collapse file tree 4 files changed +7
-68
lines changed Original file line number Diff line number Diff line change 2525 <groupId >com.fasterxml.jackson.dataformat</groupId >
2626 <artifactId >jackson-dataformat-xml</artifactId >
2727 </dependency >
28- <dependency >
29- <groupId >org.hibernate</groupId >
30- <artifactId >hibernate-entitymanager</artifactId >
31- </dependency >
32- <dependency >
33- <groupId >org.springframework</groupId >
34- <artifactId >spring-jdbc</artifactId >
35- </dependency >
36- <dependency >
37- <groupId >org.springframework.data</groupId >
38- <artifactId >spring-data-jpa</artifactId >
39- </dependency >
28+
4029 <dependency >
4130 <groupId >com.h2database</groupId >
4231 <artifactId >h2</artifactId >
4332 </dependency >
44- <dependency >
45- <groupId >org.springframework</groupId >
46- <artifactId >spring-tx</artifactId >
47- </dependency >
48- <dependency >
49- <groupId >org.springframework.data</groupId >
50- <artifactId >spring-data-commons</artifactId >
51- </dependency >
52-
33+ <dependency >
34+ <groupId >org.springframework.boot</groupId >
35+ <artifactId >spring-boot-starter-data-jpa</artifactId >
36+ </dependency >
37+
5338 <!-- util -->
5439
5540 <dependency >
Original file line number Diff line number Diff line change 2525@ EnableTransactionManagement
2626@ PropertySource ({ "classpath:persistence-${envTarget:h2}.properties" })
2727@ ComponentScan ({ "com.baeldung.persistence" })
28- // @ImportResource("classpath*:springDataPersistenceConfig.xml")
2928@ EnableJpaRepositories (basePackages = "com.baeldung.persistence.dao" )
3029public class PersistenceConfig {
3130
Original file line number Diff line number Diff line change 11package com .baeldung .spring ;
22
3- import org .springframework .context .annotation .Bean ;
4- import org .springframework .context .annotation .ComponentScan ;
53import org .springframework .context .annotation .Configuration ;
6- import org .springframework .http .MediaType ;
7- import org .springframework .web .servlet .ViewResolver ;
8- import org .springframework .web .servlet .config .annotation .ContentNegotiationConfigurer ;
9- import org .springframework .web .servlet .config .annotation .EnableWebMvc ;
10- import org .springframework .web .servlet .config .annotation .ViewControllerRegistry ;
114import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
12- import org . springframework . web . servlet . view . InternalResourceViewResolver ;
5+
136
147@ Configuration
15- @ ComponentScan ("com.baeldung.web" )
16- @ EnableWebMvc
178public class WebConfig implements WebMvcConfigurer {
189
19- public WebConfig () {
20- super ();
21- }
22-
23- @ Bean
24- public ViewResolver viewResolver () {
25- final InternalResourceViewResolver viewResolver = new InternalResourceViewResolver ();
26- viewResolver .setPrefix ("/WEB-INF/view/" );
27- viewResolver .setSuffix (".jsp" );
28- return viewResolver ;
29- }
30-
31- // API
32- @ Override
33- public void addViewControllers (final ViewControllerRegistry registry ) {
34- registry .addViewController ("/graph.html" );
35- registry .addViewController ("/homepage.html" );
36- }
37-
38- @ Override
39- public void configureContentNegotiation (ContentNegotiationConfigurer configurer ) {
40- configurer .defaultContentType (MediaType .APPLICATION_JSON );
41- }
42-
4310}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments