Rename package

This commit is contained in:
David Morley 2016-04-07 06:17:57 -05:00
parent 44eca5ba04
commit 9630170b03
30 changed files with 54 additions and 170 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
@ -27,11 +27,11 @@ public class LoggingAspect {
public void repositoryMethods() { public void repositoryMethods() {
} }
@Pointcut("@annotation(org.baeldung.aop.annotations.Loggable)") @Pointcut("@annotation(com.baeldung.aop.annotations.Loggable)")
public void loggableMethods() { public void loggableMethods() {
} }
@Pointcut("@args(org.baeldung.aop.annotations.Entity)") @Pointcut("@args(com.baeldung.aop.annotations.Entity)")
public void methodsAcceptingEntities() { public void methodsAcceptingEntities() {
} }

View File

@ -1,4 +1,4 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;

View File

@ -1,10 +1,10 @@
package org.baeldung.aop; package com.baeldung.aop;
import com.baeldung.events.FooCreationEvent;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.baeldung.events.FooCreationEvent;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.aop.annotations; package com.baeldung.aop.annotations;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,4 +1,4 @@
package org.baeldung.aop.annotations; package com.baeldung.aop.annotations;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,7 +1,7 @@
package org.baeldung.dao; package com.baeldung.dao;
import org.baeldung.aop.annotations.Loggable; import com.baeldung.aop.annotations.Loggable;
import org.baeldung.model.Foo; import com.baeldung.model.Foo;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository

View File

@ -1,9 +1,9 @@
package org.baeldung.dialect; package com.baeldung.dialect;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.baeldung.processor.NameProcessor; import com.baeldung.processor.NameProcessor;
import org.thymeleaf.dialect.AbstractDialect; import org.thymeleaf.dialect.AbstractDialect;
import org.thymeleaf.processor.IProcessor; import org.thymeleaf.processor.IProcessor;

View File

@ -1,4 +1,4 @@
package org.baeldung.events; package com.baeldung.events;
import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEvent;

View File

@ -1,4 +1,4 @@
package org.baeldung.events; package com.baeldung.events;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.model; package com.baeldung.model;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;

View File

@ -1,6 +1,6 @@
package org.baeldung.model; package com.baeldung.model;
import org.baeldung.aop.annotations.Entity; import com.baeldung.aop.annotations.Entity;
@Entity @Entity
public class Foo { public class Foo {

View File

@ -1,4 +1,4 @@
package org.baeldung.model; package com.baeldung.model;
public class User { public class User {
private String firstname; private String firstname;

View File

@ -1,4 +1,4 @@
package org.baeldung.processor; package com.baeldung.processor;
import org.thymeleaf.Arguments; import org.thymeleaf.Arguments;
import org.thymeleaf.dom.Element; import org.thymeleaf.dom.Element;

View File

@ -1,9 +1,9 @@
package org.baeldung.spring.web.config; package com.baeldung.spring.web.config;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.baeldung.dialect.CustomDialect; import com.baeldung.dialect.CustomDialect;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config; package com.baeldung.spring.web.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config; package com.baeldung.spring.web.config;
import java.util.Set; import java.util.Set;
@ -25,7 +25,7 @@ public class MainWebAppInitializer implements WebApplicationInitializer {
// Create the 'root' Spring application context // Create the 'root' Spring application context
final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
root.scan("org.baeldung.spring.web.config"); root.scan("com.baeldung.spring.web.config");
// root.getEnvironment().setDefaultProfiles("embedded"); // root.getEnvironment().setDefaultProfiles("embedded");
// Manages the lifecycle of the root application context // Manages the lifecycle of the root application context

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config; package com.baeldung.spring.web.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -16,7 +16,7 @@ import org.springframework.web.servlet.view.XmlViewResolver;
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
@ComponentScan("org.baeldung.web") @ComponentScan("com.baeldung.web")
public class WebConfig extends WebMvcConfigurerAdapter { public class WebConfig extends WebMvcConfigurerAdapter {
public WebConfig() { public WebConfig() {

View File

@ -1,4 +1,4 @@
package org.baeldung.web; package com.baeldung.web;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

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

View File

@ -1,9 +1,9 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.baeldung.model.Employee; import com.baeldung.model.Employee;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;

View File

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

View File

@ -1,6 +1,6 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import org.baeldung.model.User; import com.baeldung.model.User;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;

View File

@ -1,116 +0,0 @@
package org.baeldung.spring.web.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import org.springframework.web.servlet.view.ResourceBundleViewResolver;
import org.springframework.web.servlet.view.XmlViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan("org.baeldung.web")
public class WebConfig extends WebMvcConfigurerAdapter {
<<<<<<< HEAD
public WebConfig() {
super();
}
//
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
registry.addViewController("/sample.html");
}
@Bean
public ViewResolver internalResourceViewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setOrder(2);
return bean;
}
@Bean
public ViewResolver xmlViewResolver() {
final XmlViewResolver bean = new XmlViewResolver();
bean.setLocation(new ClassPathResource("views.xml"));
bean.setOrder(1);
return bean;
}
@Bean
public ViewResolver resourceBundleViewResolver() {
final ResourceBundleViewResolver bean = new ResourceBundleViewResolver();
bean.setBasename("views");
bean.setOrder(0);
return bean;
}
=======
public WebConfig() {
super();
}
// @Bean
// public StandardServletMultipartResolver multipartResolver() {
// return new StandardServletMultipartResolver();
// }
@Bean(name = "multipartResolver")
public CommonsMultipartResolver multipartResolver() {
final CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
multipartResolver.setMaxUploadSize(100000);
return multipartResolver;
}
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
registry.addViewController("/sample.html");
}
@Bean
public ViewResolver internalResourceViewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setOrder(2);
return bean;
}
@Bean
public ViewResolver xmlViewResolver() {
final XmlViewResolver bean = new XmlViewResolver();
bean.setLocation(new ClassPathResource("views.xml"));
bean.setOrder(1);
return bean;
}
@Bean
public ViewResolver resourceBundleViewResolver() {
final ResourceBundleViewResolver bean = new ResourceBundleViewResolver();
bean.setBasename("views");
bean.setOrder(0);
return bean;
}
>>>>>>> 3061fc7c0f9b17bf517259154900e9a70a0c512b
}

View File

@ -7,8 +7,8 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd"> http://www.springframework.org/schema/aop/spring-aop-4.2.xsd">
<bean id="perfomanceMeter" class="org.baeldung.aop.PerformanceAspect"/> <bean id="perfomanceMeter" class="com.baeldung.aop.PerformanceAspect"/>
<bean id="fooDao" class="org.baeldung.dao.FooDao"/> <bean id="fooDao" class="com.baeldung.dao.FooDao"/>
<aop:config> <aop:config>
<aop:pointcut id="anyDaoMethod" expression="@target(org.springframework.stereotype.Repository)"/> <aop:pointcut id="anyDaoMethod" expression="@target(org.springframework.stereotype.Repository)"/>

View File

@ -16,7 +16,7 @@
</context-param> </context-param>
<context-param> <context-param>
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.spring.web.config</param-value> <param-value>com.baeldung.spring.web.config</param-value>
</context-param> </context-param>
<listener> <listener>

View File

@ -1,8 +1,8 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.baeldung.config.TestConfig; import com.baeldung.config.TestConfig;
import org.baeldung.dao.FooDao; import com.baeldung.dao.FooDao;
import org.baeldung.model.Foo; import com.baeldung.model.Foo;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,7 +1,7 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.baeldung.config.TestConfig; import com.baeldung.config.TestConfig;
import org.baeldung.dao.FooDao; import com.baeldung.dao.FooDao;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,9 +1,9 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.baeldung.config.TestConfig; import com.baeldung.config.TestConfig;
import org.baeldung.dao.FooDao; import com.baeldung.dao.FooDao;
import org.baeldung.events.FooCreationEventListener; import com.baeldung.events.FooCreationEventListener;
import org.baeldung.model.Foo; import com.baeldung.model.Foo;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,6 +1,6 @@
package org.baeldung.aop; package com.baeldung.aop;
import org.baeldung.dao.FooDao; import com.baeldung.dao.FooDao;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -21,7 +21,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/org/baeldung/aop/beans.xml") @ContextConfiguration("/com/baeldung/aop/beans.xml")
public class AopXmlConfigPerformanceTest { public class AopXmlConfigPerformanceTest {
@Before @Before

View File

@ -1,11 +1,11 @@
package org.baeldung.config; package com.baeldung.config;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.EnableAspectJAutoProxy;
@Configuration @Configuration
@ComponentScan(basePackages = { "org.baeldung.dao", "org.baeldung.aop", "org.baeldung.events" }) @ComponentScan(basePackages = { "com.baeldung.dao", "com.baeldung.aop", "com.baeldung.events" })
@EnableAspectJAutoProxy @EnableAspectJAutoProxy
public class TestConfig { public class TestConfig {
} }