cleanup; fix code formatting

This commit is contained in:
Denis 2019-10-06 19:37:23 +02:00
parent 6839533ec0
commit 56102c9a51
25 changed files with 223 additions and 216 deletions

View File

@ -1,3 +1,3 @@
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="kbase" packages="com.baeldung.process" /> <kbase name="kbase" packages="com.baeldung.process"/>
</kmodule> </kmodule>

View File

@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="employeeReport" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
<parameter name="idEmployee" class="java.lang.Integer" isForPrompting="false"/> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<queryString> xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
<![CDATA[SELECT * FROM EMAIL WHERE ID_EMPLOYEE = $P{idEmployee}]]> name="employeeReport" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20"
</queryString> topMargin="20" bottomMargin="20">
<field name="ADDRESS" class="java.lang.String"/> <parameter name="idEmployee" class="java.lang.Integer" isForPrompting="false"/>
<detail> <queryString>
<band height="20" splitType="Stretch"> <![CDATA[SELECT * FROM EMAIL WHERE ID_EMPLOYEE = $P{idEmployee}]]>
<textField> </queryString>
<reportElement x="0" y="0" width="156" height="20"/> <field name="ADDRESS" class="java.lang.String"/>
<textElement/> <detail>
<textFieldExpression class="java.lang.String"><![CDATA[$F{ADDRESS}]]></textFieldExpression> <band height="20" splitType="Stretch">
</textField> <textField>
</band> <reportElement x="0" y="0" width="156" height="20"/>
</detail> <textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{ADDRESS}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport> </jasperReport>

View File

@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="employeeReport" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
name="employeeReport" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20"
topMargin="20" bottomMargin="20">
<parameter name="title" class="java.lang.String" isForPrompting="false"/> <parameter name="title" class="java.lang.String" isForPrompting="false"/>
<parameter name="condition" class="java.lang.String" isForPrompting="false"> <parameter name="condition" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[" 1 = 1"]]></defaultValueExpression> <defaultValueExpression><![CDATA[" 1 = 1"]]></defaultValueExpression>
</parameter> </parameter>
<parameter name="minSalary" class="java.lang.Double" isForPrompting="false"/> <parameter name="minSalary" class="java.lang.Double" isForPrompting="false"/>
<queryString> <queryString>
<![CDATA[SELECT * FROM EMPLOYEE WHERE SALARY >= $P{minSalary} AND $P!{condition}]]> <![CDATA[SELECT * FROM EMPLOYEE WHERE SALARY >= $P{minSalary} AND $P!{condition}]]>
</queryString> </queryString>
<field name="FIRST_NAME" class="java.lang.String"/> <field name="FIRST_NAME" class="java.lang.String"/>
<field name="LAST_NAME" class="java.lang.String"/> <field name="LAST_NAME" class="java.lang.String"/>
@ -44,7 +48,8 @@
<subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpression> <subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpression>
</subreportParameter> </subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["employeeEmailReport.jasper"]]></subreportExpression> <subreportExpression class="java.lang.String">
<![CDATA["employeeEmailReport.jasper"]]></subreportExpression>
</subreport> </subreport>
</band> </band>
</detail> </detail>

View File

@ -26,54 +26,54 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration @ContextConfiguration
public class CacheEvictAnnotationIntegrationTest { public class CacheEvictAnnotationIntegrationTest {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class ContextConfiguration { static class ContextConfiguration {
@Bean @Bean
public CachingService cachingService() { public CachingService cachingService() {
return new CachingService(); return new CachingService();
} }
@Bean @Bean
public CacheManager cacheManager(){ public CacheManager cacheManager() {
SimpleCacheManager cacheManager = new SimpleCacheManager(); SimpleCacheManager cacheManager = new SimpleCacheManager();
List<Cache> caches = new ArrayList<>(); List<Cache> caches = new ArrayList<>();
caches.add(cacheBean().getObject()); caches.add(cacheBean().getObject());
cacheManager.setCaches(caches ); cacheManager.setCaches(caches);
return cacheManager; return cacheManager;
} }
@Bean @Bean
public ConcurrentMapCacheFactoryBean cacheBean(){ public ConcurrentMapCacheFactoryBean cacheBean() {
ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean();
cacheFactoryBean.setName("first"); cacheFactoryBean.setName("first");
return cacheFactoryBean; return cacheFactoryBean;
} }
} }
@Autowired @Autowired
CachingService cachingService; CachingService cachingService;
@Before @Before
public void before() { public void before() {
cachingService.putToCache("first", "key1", "Baeldung"); cachingService.putToCache("first", "key1", "Baeldung");
cachingService.putToCache("first", "key2", "Article"); cachingService.putToCache("first", "key2", "Article");
} }
@Test @Test
public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() { public void givenFirstCache_whenSingleCacheValueEvictRequested_thenEmptyCacheValue() {
cachingService.evictSingleCacheValue("key1"); cachingService.evictSingleCacheValue("key1");
String key1 = cachingService.getFromCache("first", "key1"); String key1 = cachingService.getFromCache("first", "key1");
assertThat(key1, is(nullValue())); assertThat(key1, is(nullValue()));
} }
@Test @Test
public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() { public void givenFirstCache_whenAllCacheValueEvictRequested_thenEmptyCache() {
cachingService.evictAllCacheValues(); cachingService.evictAllCacheValues();
String key1 = cachingService.getFromCache("first", "key1"); String key1 = cachingService.getFromCache("first", "key1");
String key2 = cachingService.getFromCache("first", "key2"); String key2 = cachingService.getFromCache("first", "key2");
assertThat(key1, is(nullValue())); assertThat(key1, is(nullValue()));
assertThat(key2, is(nullValue())); assertThat(key2, is(nullValue()));
} }
} }

View File

@ -25,38 +25,38 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration @ContextConfiguration
public class CacheManagerEvictIntegrationTest { public class CacheManagerEvictIntegrationTest {
@Configuration @Configuration
static class ContextConfiguration { static class ContextConfiguration {
@Bean @Bean
public CachingService cachingService() { public CachingService cachingService() {
return new CachingService(); return new CachingService();
} }
@Bean @Bean
public CacheManager cacheManager(){ public CacheManager cacheManager() {
SimpleCacheManager cacheManager = new SimpleCacheManager(); SimpleCacheManager cacheManager = new SimpleCacheManager();
List<Cache> caches = new ArrayList<>(); List<Cache> caches = new ArrayList<>();
caches.add(cacheBeanFirst().getObject()); caches.add(cacheBeanFirst().getObject());
caches.add(cacheBeanSecond().getObject()); caches.add(cacheBeanSecond().getObject());
cacheManager.setCaches(caches ); cacheManager.setCaches(caches);
return cacheManager; return cacheManager;
} }
@Bean @Bean
public ConcurrentMapCacheFactoryBean cacheBeanFirst(){ public ConcurrentMapCacheFactoryBean cacheBeanFirst() {
ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean();
cacheFactoryBean.setName("first"); cacheFactoryBean.setName("first");
return cacheFactoryBean; return cacheFactoryBean;
} }
@Bean @Bean
public ConcurrentMapCacheFactoryBean cacheBeanSecond(){ public ConcurrentMapCacheFactoryBean cacheBeanSecond() {
ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean(); ConcurrentMapCacheFactoryBean cacheFactoryBean = new ConcurrentMapCacheFactoryBean();
cacheFactoryBean.setName("second"); cacheFactoryBean.setName("second");
return cacheFactoryBean; return cacheFactoryBean;
} }
} }
@Autowired @Autowired
CachingService cachingService; CachingService cachingService;

View File

@ -39,11 +39,6 @@
<groupId>org.springframework.retry</groupId> <groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId> <artifactId>spring-retry</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.shell</groupId>
<artifactId>spring-shell</artifactId>
<version>${org.springframework.shell.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId> <artifactId>spring-websocket</artifactId>
@ -104,17 +99,6 @@
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>${guava.version}</version> <version>${guava.version}</version>
</dependency> </dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>${jasperreports.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- test scoped --> <!-- test scoped -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@ -218,7 +202,6 @@
<start-class>org.baeldung.sample.App</start-class> <start-class>org.baeldung.sample.App</start-class>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>5.0.6.RELEASE</org.springframework.version> <org.springframework.version>5.0.6.RELEASE</org.springframework.version>
<org.springframework.shell.version>1.2.0.RELEASE</org.springframework.shell.version>
<annotation-api.version>1.3.2</annotation-api.version> <annotation-api.version>1.3.2</annotation-api.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>5.2.5.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
@ -227,7 +210,6 @@
<guava.version>25.1-jre</guava.version> <guava.version>25.1-jre</guava.version>
<easymock.version>3.6</easymock.version> <easymock.version>3.6</easymock.version>
<assertj.version>3.6.1</assertj.version> <assertj.version>3.6.1</assertj.version>
<jasperreports.version>6.6.0</jasperreports.version>
<shedlock.version>2.1.0</shedlock.version> <shedlock.version>2.1.0</shedlock.version>
<javassist.version>3.22.0-GA</javassist.version> <javassist.version>3.22.0-GA</javassist.version>
</properties> </properties>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ship" class="org.baeldung.bean.injection.Ship"> <bean id="ship" class="org.baeldung.bean.injection.Ship">
<constructor-arg> <constructor-arg>
<ref bean="helm" /> <ref bean="helm"/>
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="helm" class="org.baeldung.bean.injection.Helm" /> <bean id="helm" class="org.baeldung.bean.injection.Helm"/>
</beans> </beans>

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ship" class="org.baeldung.bean.injection.Ship"> <bean id="ship" class="org.baeldung.bean.injection.Ship">
<property name="helm"> <property name="helm">
<ref bean="helm" /> <ref bean="helm"/>
</property> </property>
</bean> </bean>
<bean id="helm" class="org.baeldung.bean.injection.Helm" /> <bean id="helm" class="org.baeldung.bean.injection.Helm"/>
</beans> </beans>

View File

@ -7,13 +7,13 @@
</encoder> </encoder>
</appender> </appender>
<logger name="org.springframework" level="WARN" /> <logger name="org.springframework" level="WARN"/>
<logger name="org.springframework.transaction" level="WARN" /> <logger name="org.springframework.transaction" level="WARN"/>
<!-- in order to debug some marshalling issues, this needs to be TRACE --> <!-- in order to debug some marshalling issues, this needs to be TRACE -->
<logger name="org.springframework.web.servlet.mvc" level="WARN" /> <logger name="org.springframework.web.servlet.mvc" level="WARN"/>
<root level="INFO"> <root level="INFO">
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT"/>
</root> </root>
</configuration> </configuration>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="personSingleton" class="org.baeldung.scopes.Person" scope="singleton"/> <bean id="personSingleton" class="org.baeldung.scopes.Person" scope="singleton"/>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
> >

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"> 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="org.baeldung.controller.controller"/>
<mvc:annotation-driven /> <mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix"> <property name="prefix">
<value>/WEB-INF/</value> <value>/WEB-INF/</value>
</property> </property>
<property name="suffix"> <property name="suffix">
<value>.jsp</value> <value>.jsp</value>
</property> </property>
</bean> </bean>
</beans> </beans>

View File

@ -1,11 +1,11 @@
<?xml version = "1.0" encoding = "UTF-8"?> <?xml version = "1.0" encoding = "UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="greeting" class="com.baeldung.contexts.Greeting"> <bean id="greeting" class="com.baeldung.contexts.Greeting">
<property name="message" value="Hello World !!" /> <property name="message" value="Hello World !!"/>
</bean> </bean>
</beans> </beans>

View File

@ -1,16 +1,16 @@
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.baeldung.contexts.normal" /> <context:component-scan base-package="com.baeldung.contexts.normal"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/view/" /> <property name="prefix" value="/WEB-INF/view/"/>
<property name="suffix" value=".jsp" /> <property name="suffix" value=".jsp"/>
</bean> </bean>
</beans> </beans>

View File

@ -1,14 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8"?> <?xml version = "1.0" encoding = "UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.baeldung.contexts.services" /> <context:component-scan base-package="com.baeldung.contexts.services"/>
<import resource="greeting.xml" /> <import resource="greeting.xml"/>
</beans> </beans>

View File

@ -1,16 +1,16 @@
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.baeldung.contexts.secure" /> <context:component-scan base-package="com.baeldung.contexts.secure"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/secure/view/" /> <property name="prefix" value="/WEB-INF/secure/view/"/>
<property name="suffix" value=".jsp" /> <property name="suffix" value=".jsp"/>
</bean> </bean>
</beans> </beans>

View File

@ -2,6 +2,6 @@
<head></head> <head></head>
<body> <body>
<h1>This is the body of the sample view</h1> <h1>This is the body of the sample view</h1>
</body> </body>
</html> </html>

View File

@ -2,9 +2,9 @@
<head></head> <head></head>
<body> <body>
<h1>Bean Scopes Examples</h1> <h1>Bean Scopes Examples</h1>
<br> Previous Message: ${previousMessage } <br> Previous Message: ${previousMessage }
<br> Current Message: ${currentMessage } <br> Current Message: ${currentMessage }
<br> <br>
</body> </body>
</html> </html>

View File

@ -1,11 +1,11 @@
<html> <html>
<head> <head>
<title>Spring Web Contexts</title> <title>Spring Web Contexts</title>
</head> </head>
<body> <body>
<br> <br>
<div style="padding: 10px; border-radius: 10px; font-size: 30px; text-align: center;"> <div style="padding: 10px; border-radius: 10px; font-size: 30px; text-align: center;">
Normal Web Application : ${message} Normal Web Application : ${message}
</div> </div>
</body> </body>
</html> </html>

View File

@ -15,10 +15,10 @@
org.springframework.web.context.ContextLoaderListener org.springframework.web.context.ContextLoaderListener
</listener-class> </listener-class>
</listener>--> </listener>-->
<!--<context-param> <!--<context-param>
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/rootApplicationContext.xml</param-value> <param-value>/WEB-INF/rootApplicationContext.xml</param-value>
</context-param>--> </context-param>-->
<!--<context-param> <!--<context-param>
<param-name>contextClass</param-name> <param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value> <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
@ -32,7 +32,7 @@
<param-value>org.baeldung.bean.config</param-value> <param-value>org.baeldung.bean.config</param-value>
</context-param>--> </context-param>-->
<!-- secure web app context --> <!-- secure web app context -->
<!--<servlet> <!--<servlet>
<servlet-name>secure-webapp</servlet-name> <servlet-name>secure-webapp</servlet-name>
<servlet-class> <servlet-class>

View File

@ -1,10 +1,10 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%> pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title> <title>Insert title here</title>
</head> </head>
<body> <body>
Data returned is ${data} Data returned is ${data}

View File

@ -26,6 +26,11 @@
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId> <artifactId>spring-aspects</artifactId>
</dependency> </dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${annotation-api.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
@ -33,4 +38,8 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<annotation-api.version>1.3.2</annotation-api.version>
</properties>
</project> </project>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.2.xsd xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
> >

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task" <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.2.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"
@ -18,8 +19,11 @@
<bean id="schedulingWithXmlConfig" class="org.baeldung.scheduling.SchedulingWithXmlConfig"/> <bean id="schedulingWithXmlConfig" class="org.baeldung.scheduling.SchedulingWithXmlConfig"/>
<task:scheduled-tasks scheduler="myScheduler"> <task:scheduled-tasks scheduler="myScheduler">
<task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedDelayTask" fixed-delay="${fixedDelay.in.milliseconds}" initial-delay="1000"/> <task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedDelayTask"
<task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedRateTask" fixed-rate="${fixedRate.in.milliseconds}"/> fixed-delay="${fixedDelay.in.milliseconds}" initial-delay="1000"/>
<task:scheduled ref="schedulingWithXmlConfig" method="scheduleTaskUsingCronExpression" cron="${cron.expression}"/> <task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedRateTask"
fixed-rate="${fixedRate.in.milliseconds}"/>
<task:scheduled ref="schedulingWithXmlConfig" method="scheduleTaskUsingCronExpression"
cron="${cron.expression}"/>
</task:scheduled-tasks> </task:scheduled-tasks>
</beans> </beans>

View File

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">
<context:component-scan base-package="org.baeldung.shell.simple" /> <context:component-scan base-package="org.baeldung.shell.simple"/>
</beans> </beans>