Merge pull request #8749 from Maiklins/JAVA-633-standardize-packages-spring-mvc

Java-633 standardize packages spring mvc
This commit is contained in:
Loredana Crusoveanu 2020-02-23 16:16:46 +02:00 committed by GitHub
commit 39bcf24936
63 changed files with 119 additions and 101 deletions

View File

@ -36,12 +36,12 @@
<profiles>
<profile>
<id>default-tools.jar</id>
<id>default-profile</id>
<activation>
<property>
<name>java.vendor</name>
<value>Oracle Corporation</value>
</property>
<activeByDefault>true</activeByDefault>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
@ -53,6 +53,24 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>mac-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../Classes/classes.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
<properties>

View File

@ -138,7 +138,7 @@
<properties>
<!-- The main class to start by executing java -jar -->
<start-class>org.baeldung.boot.Application</start-class>
<start-class>com.baeldung.boot.Application</start-class>
<jquery.version>3.1.1</jquery.version>
<bootstrap.version>3.3.7-1</bootstrap.version>
<jpa.version>2.2</jpa.version>

View File

@ -1,4 +1,4 @@
package org.baeldung.boot;
package com.baeldung.boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,12 +1,12 @@
package org.baeldung.boot.config;
package com.baeldung.boot.config;
import java.util.List;
import org.baeldung.boot.converter.GenericBigDecimalConverter;
import org.baeldung.boot.converter.StringToAbstractEntityConverterFactory;
import org.baeldung.boot.converter.StringToEmployeeConverter;
import org.baeldung.boot.converter.StringToEnumConverter;
import org.baeldung.boot.web.resolver.HeaderVersionArgumentResolver;
import com.baeldung.boot.converter.GenericBigDecimalConverter;
import com.baeldung.boot.converter.StringToAbstractEntityConverterFactory;
import com.baeldung.boot.converter.StringToEmployeeConverter;
import com.baeldung.boot.converter.StringToEnumConverter;
import com.baeldung.boot.web.resolver.HeaderVersionArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;

View File

@ -1,8 +1,8 @@
package org.baeldung.boot.controller;
package com.baeldung.boot.controller;
import org.baeldung.boot.domain.GenericEntity;
import org.baeldung.boot.domain.Modes;
import org.baeldung.boot.web.resolver.Version;
import com.baeldung.boot.domain.GenericEntity;
import com.baeldung.boot.domain.Modes;
import com.baeldung.boot.web.resolver.Version;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.converter;
package com.baeldung.boot.converter;
import com.google.common.collect.ImmutableSet;
import org.springframework.core.convert.TypeDescriptor;

View File

@ -1,8 +1,8 @@
package org.baeldung.boot.converter;
package com.baeldung.boot.converter;
import org.baeldung.boot.domain.AbstractEntity;
import org.baeldung.boot.domain.Bar;
import org.baeldung.boot.domain.Foo;
import com.baeldung.boot.domain.AbstractEntity;
import com.baeldung.boot.domain.Bar;
import com.baeldung.boot.domain.Foo;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

View File

@ -1,6 +1,6 @@
package org.baeldung.boot.converter;
package com.baeldung.boot.converter;
import org.baeldung.boot.domain.Employee;
import com.baeldung.boot.domain.Employee;
import org.springframework.core.convert.converter.Converter;
public class StringToEmployeeConverter implements Converter<String, Employee> {

View File

@ -1,6 +1,6 @@
package org.baeldung.boot.converter;
package com.baeldung.boot.converter;
import org.baeldung.boot.domain.Modes;
import com.baeldung.boot.domain.Modes;
import org.springframework.core.convert.converter.Converter;
public class StringToEnumConverter implements Converter<String, Modes> {

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.converter;
package com.baeldung.boot.converter;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

View File

@ -1,8 +1,8 @@
package org.baeldung.boot.converter.controller;
package com.baeldung.boot.converter.controller;
import org.baeldung.boot.domain.Bar;
import org.baeldung.boot.domain.Foo;
import org.baeldung.boot.domain.Modes;
import com.baeldung.boot.domain.Bar;
import com.baeldung.boot.domain.Foo;
import com.baeldung.boot.domain.Modes;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

View File

@ -1,6 +1,6 @@
package org.baeldung.boot.converter.controller;
package com.baeldung.boot.converter.controller;
import org.baeldung.boot.domain.Employee;
import com.baeldung.boot.domain.Employee;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
public abstract class AbstractEntity {

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
public class Bar extends AbstractEntity {

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
public class Foo extends AbstractEntity {

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.domain;
package com.baeldung.boot.domain;
public enum Modes {

View File

@ -1,6 +1,6 @@
package org.baeldung.boot.repository;
package com.baeldung.boot.repository;
import org.baeldung.boot.domain.GenericEntity;
import com.baeldung.boot.domain.GenericEntity;
import org.springframework.data.jpa.repository.JpaRepository;
public interface GenericEntityRepository extends JpaRepository<GenericEntity, Long> {

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.web.resolver;
package com.baeldung.boot.web.resolver;
import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.boot.web.resolver;
package com.baeldung.boot.web.resolver;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.ByteArrayInputStream;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@ -6,12 +6,12 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* To initialize the WebApplication, Please see
* {@link org.baeldung.spring.config.MainWebAppInitializer}
* {@link com.baeldung.spring.config.MainWebAppInitializer}
*/
@EnableWebMvc
@Configuration
@ComponentScan(basePackages = "org.baeldung.cachedrequest")
@ComponentScan(basePackages = "com.baeldung.cachedrequest")
public class HttpRequestDemoConfig implements WebMvcConfigurer {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
public class Person {
private String firstName;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.IOException;

View File

@ -1,7 +1,7 @@
package com.baeldung;
import org.baeldung.boot.Application;
import org.baeldung.boot.domain.Modes;
import com.baeldung.boot.Application;
import com.baeldung.boot.domain.Modes;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,8 +1,8 @@
package com.baeldung;
import org.baeldung.boot.Application;
import org.baeldung.boot.domain.GenericEntity;
import org.baeldung.boot.repository.GenericEntityRepository;
import com.baeldung.boot.Application;
import com.baeldung.boot.domain.GenericEntity;
import com.baeldung.boot.repository.GenericEntityRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,6 +1,6 @@
package com.baeldung;
import org.baeldung.boot.Application;
import com.baeldung.boot.Application;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.BufferedReader;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;

View File

@ -1,4 +1,4 @@
package org.baeldung.cachedrequest;
package com.baeldung.cachedrequest;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.baeldung.controller.config;
package com.baeldung.controller.config;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;

View File

@ -1,4 +1,4 @@
package org.baeldung.controller.config;
package com.baeldung.controller.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -11,7 +11,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = { "org.baeldung.controller.controller", "com.baeldung.controller", "org.baeldung.controller.config" })
@ComponentScan(basePackages = { "com.baeldung.controller.controller", "com.baeldung.controller", "com.baeldung.controller.config" })
public class WebConfig implements WebMvcConfigurer {
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {

View File

@ -1,4 +1,4 @@
package org.baeldung.controller.controller;
package com.baeldung.controller.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

View File

@ -1,6 +1,6 @@
package org.baeldung.controller.controller;
package com.baeldung.controller.controller;
import org.baeldung.controller.student.Student;
import com.baeldung.controller.student.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

View File

@ -1,6 +1,6 @@
package org.baeldung.controller.controller;
package com.baeldung.controller.controller;
import org.baeldung.controller.student.Student;
import com.baeldung.controller.student.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

View File

@ -2,7 +2,7 @@
/**
* @author Prashant Dutta
*/
package org.baeldung.controller.controller;
package com.baeldung.controller.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.controller.student;
package com.baeldung.controller.student;
public class Student {
private String name;

View File

@ -10,7 +10,7 @@
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<context:component-scan base-package="org.baeldung.controller.controller"/>
<context:component-scan base-package="com.baeldung.controller.controller"/>
<mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">

View File

@ -29,7 +29,7 @@
</context-param>-->
<!--<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.bean.config</param-value>
<param-value>com.baeldung.bean.config</param-value>
</context-param>-->
<!-- secure web app context -->

View File

@ -1,8 +1,8 @@
package org.baeldung.controller;
package com.baeldung.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.baeldung.controller.config.WebConfig;
import org.baeldung.controller.student.Student;
import com.baeldung.controller.config.WebConfig;
import com.baeldung.controller.student.Student;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.controller;
package com.baeldung.controller;
import org.junit.Assert;
import org.junit.Before;
@ -14,7 +14,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.ModelAndView;
import org.baeldung.controller.student.Student;
import com.baeldung.controller.student.Student;
import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(SpringJUnit4ClassRunner.class)

View File

@ -1,4 +1,4 @@
package org.baeldung.controller;
package com.baeldung.controller;
import org.junit.Assert;
import org.junit.Before;
@ -15,7 +15,7 @@ import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.ModelAndView;
/**
* This is the test class for {@link org.baeldung.controller.controller.PassParametersController} class.
* This is the test class for {@link com.baeldung.controller.controller.PassParametersController} class.
* 09/09/2017
*
* @author Ahmet Cetin

View File

@ -12,7 +12,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.baeldung.controller.config.WebConfig;
import com.baeldung.controller.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -12,7 +12,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.baeldung.controller.config.WebConfig;
import com.baeldung.controller.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -12,7 +12,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.baeldung.controller.config.WebConfig;
import com.baeldung.controller.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -12,7 +12,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.baeldung.controller.config.WebConfig;
import com.baeldung.controller.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -12,7 +12,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.baeldung.controller.config.WebConfig;
import com.baeldung.controller.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -10,7 +10,7 @@
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<context:component-scan base-package="org.baeldung.controller.controller" />
<context:component-scan base-package="com.baeldung.controller.controller" />
<mvc:annotation-driven />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import com.baeldung.springmvcforms.configuration.ApplicationConfiguration;

View File

@ -1,4 +1,4 @@
package org.baeldung.listbindingexample;
package com.baeldung.listbindingexample;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.sessionattrs;
package com.baeldung.sessionattrs;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,9 +1,9 @@
package org.baeldung.servlet;
package com.baeldung.servlet;
import javax.servlet.ServletRegistration.Dynamic;
import org.baeldung.spring.WebFlowConfig;
import org.baeldung.spring.WebMvcConfig;
import com.baeldung.spring.WebFlowConfig;
import com.baeldung.spring.WebMvcConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class WebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

View File

@ -1,4 +1,4 @@
package org.baeldung.spring;
package com.baeldung.spring;
import java.util.Collections;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring;
package com.baeldung.spring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

View File

@ -1,7 +1,7 @@
package org.baeldung;
package com.baeldung;
import org.baeldung.spring.WebFlowConfig;
import org.baeldung.spring.WebMvcConfig;
import com.baeldung.spring.WebFlowConfig;
import com.baeldung.spring.WebMvcConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;