BAEL-226 - Source code for wicket
This commit is contained in:
		
							parent
							
								
									b8eb2a799a
								
							
						
					
					
						commit
						cf53bc6585
					
				
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @ -101,7 +101,7 @@ | |||||||
|         <module>lombok</module> |         <module>lombok</module> | ||||||
|         <module>redis</module> |         <module>redis</module> | ||||||
|         <module>webjars</module> |         <module>webjars</module> | ||||||
|         <module>wicket-intro</module> |         <module>wicket</module> | ||||||
| 
 | 
 | ||||||
| 		<module>mutation-testing</module> | 		<module>mutation-testing</module> | ||||||
| 		<module>spring-mvc-velocity</module> | 		<module>spring-mvc-velocity</module> | ||||||
|  | |||||||
| @ -1,10 +0,0 @@ | |||||||
| package com.baeldung.wicket.examples; |  | ||||||
| 
 |  | ||||||
| import org.springframework.context.annotation.ComponentScan; |  | ||||||
| import org.springframework.context.annotation.Configuration; |  | ||||||
| 
 |  | ||||||
| @Configuration |  | ||||||
| @ComponentScan |  | ||||||
| public class ApplicationConfiguration { |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -1,26 +0,0 @@ | |||||||
| package com.baeldung.wicket.examples; |  | ||||||
| 
 |  | ||||||
| import javax.servlet.FilterRegistration; |  | ||||||
| import javax.servlet.ServletContext; |  | ||||||
| import javax.servlet.ServletException; |  | ||||||
| 
 |  | ||||||
| import org.apache.wicket.protocol.http.WicketFilter; |  | ||||||
| import org.springframework.web.WebApplicationInitializer; |  | ||||||
| import org.springframework.web.context.ContextLoaderListener; |  | ||||||
| import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; |  | ||||||
| 
 |  | ||||||
| public class WebAppInitializer implements WebApplicationInitializer { |  | ||||||
| 
 |  | ||||||
|     @Override |  | ||||||
|     public void onStartup(ServletContext container) throws ServletException { |  | ||||||
|         AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); |  | ||||||
|         container.addListener(new ContextLoaderListener(context)); |  | ||||||
|         context.register(ApplicationConfiguration.class); |  | ||||||
| 
 |  | ||||||
|         FilterRegistration filter = container.addFilter("ExamplesApplication", WicketFilter.class); |  | ||||||
|         filter.setInitParameter("applicationClassName", ExamplesApplication.class.getName()); |  | ||||||
|         filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*"); |  | ||||||
|         filter.addMappingForUrlPatterns(null, false, "/*"); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||||||
| 
 | 
 | ||||||
|     <modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
|     <groupId>com.baeldung.wicket.examples</groupId> |     <groupId>com.baeldung.wicket.examples</groupId> | ||||||
| @ -13,13 +13,9 @@ | |||||||
|         <jetty9.version>9.2.13.v20150730</jetty9.version> |         <jetty9.version>9.2.13.v20150730</jetty9.version> | ||||||
|         <log4j.version>2.5</log4j.version> |         <log4j.version>2.5</log4j.version> | ||||||
|         <junit.version>4.12</junit.version> |         <junit.version>4.12</junit.version> | ||||||
|         <spring-web.version>4.1.1.RELEASE</spring-web.version> |  | ||||||
|         <javax.servlet-api.version>3.1.0</javax.servlet-api.version> |  | ||||||
|         <wicket-spring.version>8.0.0-M1</wicket-spring.version> |  | ||||||
|         <maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> |         <maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> | ||||||
|         <maven-war-plugin.version>2.6</maven-war-plugin.version> |         <maven-war-plugin.version>2.6</maven-war-plugin.version> | ||||||
|         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||||||
|         <wtp.version>none</wtp.version> |  | ||||||
|     </properties> |     </properties> | ||||||
|     <dependencies> |     <dependencies> | ||||||
|         <!-- WICKET DEPENDENCIES --> |         <!-- WICKET DEPENDENCIES --> | ||||||
| @ -29,24 +25,6 @@ | |||||||
|             <version>${wicket.version}</version> |             <version>${wicket.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
| 
 | 
 | ||||||
|         <!-- SPRING DEPENDENCIES --> |  | ||||||
| 
 |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.springframework</groupId> |  | ||||||
|             <artifactId>spring-web</artifactId> |  | ||||||
|             <version>${spring-web.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>javax.servlet</groupId> |  | ||||||
|             <artifactId>javax.servlet-api</artifactId> |  | ||||||
|             <version>${javax.servlet-api.version}</version> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.apache.wicket</groupId> |  | ||||||
|             <artifactId>wicket-spring</artifactId> |  | ||||||
|             <version>${wicket-spring.version}</version> |  | ||||||
|         </dependency> |  | ||||||
| 
 |  | ||||||
|         <!-- JUNIT DEPENDENCY FOR TESTING --> |         <!-- JUNIT DEPENDENCY FOR TESTING --> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>junit</groupId> |             <groupId>junit</groupId> | ||||||
| @ -64,7 +42,6 @@ | |||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
|     <build> |     <build> | ||||||
|         <finalName>WicketIntro</finalName> |  | ||||||
|         <resources> |         <resources> | ||||||
|             <resource> |             <resource> | ||||||
|                 <filtering>false</filtering> |                 <filtering>false</filtering> | ||||||
| @ -81,6 +58,22 @@ | |||||||
|                 </excludes> |                 </excludes> | ||||||
|             </resource> |             </resource> | ||||||
|         </resources> |         </resources> | ||||||
|  |         <testResources> | ||||||
|  |             <testResource> | ||||||
|  |                 <filtering>false</filtering> | ||||||
|  |                 <directory>src/test/resources</directory> | ||||||
|  |             </testResource> | ||||||
|  |             <testResource> | ||||||
|  |                 <filtering>false</filtering> | ||||||
|  |                 <directory>src/test/java</directory> | ||||||
|  |                 <includes> | ||||||
|  |                     <include>**</include> | ||||||
|  |                 </includes> | ||||||
|  |                 <excludes> | ||||||
|  |                     <exclude>**/*.java</exclude> | ||||||
|  |                 </excludes> | ||||||
|  |             </testResource> | ||||||
|  |         </testResources> | ||||||
|         <plugins> |         <plugins> | ||||||
|             <plugin> |             <plugin> | ||||||
|                 <inherited>true</inherited> |                 <inherited>true</inherited> | ||||||
| @ -110,17 +103,4 @@ | |||||||
|             </plugin> |             </plugin> | ||||||
|         </plugins> |         </plugins> | ||||||
|     </build> |     </build> | ||||||
| 
 |  | ||||||
|     <repositories> |  | ||||||
|         <repository> |  | ||||||
|             <id>Apache Nexus</id> |  | ||||||
|             <url>https://repository.apache.org/content/repositories/snapshots/</url> |  | ||||||
|             <releases> |  | ||||||
|                 <enabled>false</enabled> |  | ||||||
|             </releases> |  | ||||||
|             <snapshots> |  | ||||||
|                 <enabled>true</enabled> |  | ||||||
|             </snapshots> |  | ||||||
|         </repository> |  | ||||||
|     </repositories> |  | ||||||
| </project> | </project> | ||||||
| @ -0,0 +1,23 @@ | |||||||
|  | package com.baeldung.wicket.examples; | ||||||
|  | 
 | ||||||
|  | import org.apache.wicket.util.tester.WicketTester; | ||||||
|  | import org.junit.Before; | ||||||
|  | import org.junit.Test; | ||||||
|  | 
 | ||||||
|  | public class TestHomePage { | ||||||
|  |     private WicketTester tester; | ||||||
|  | 
 | ||||||
|  |     @Before | ||||||
|  |     public void setUp() { | ||||||
|  |         tester = new WicketTester(new ExamplesApplication()); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Test | ||||||
|  |     public void whenPageInvoked_thanRenderedOK() { | ||||||
|  |         //start and render the test page | ||||||
|  |         tester.startPage(Examples.class); | ||||||
|  | 
 | ||||||
|  |         //assert rendered page class | ||||||
|  |         tester.assertRenderedPage(Examples.class); | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										32
									
								
								wicket/src/main/webapp/WEB-INF/web.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								wicket/src/main/webapp/WEB-INF/web.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | |||||||
|  | <?xml version="1.0" encoding="ISO-8859-1"?> | ||||||
|  | <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||
|  |          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_0.xsd" | ||||||
|  |          version="3.0"> | ||||||
|  | 
 | ||||||
|  |     <display-name>CafeAddress</display-name> | ||||||
|  | 
 | ||||||
|  |     <!-- | ||||||
|  |         There are three means to configure Wickets configuration mode and they | ||||||
|  |         are tested in the order given. | ||||||
|  | 
 | ||||||
|  |         1) A system property: -Dwicket.configuration | ||||||
|  |         2) servlet specific <init-param> | ||||||
|  |         3) context specific <context-param> | ||||||
|  | 
 | ||||||
|  |         The value might be either "development" (reloading when templates change) or | ||||||
|  |         "deployment". If no configuration is found, "development" is the default. --> | ||||||
|  | 
 | ||||||
|  |     <filter> | ||||||
|  |         <filter-name>wicket.examples</filter-name> | ||||||
|  |         <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> | ||||||
|  |         <init-param> | ||||||
|  |             <param-name>applicationClassName</param-name> | ||||||
|  |             <param-value>com.baeldung.wicket.examples.ExamplesApplication</param-value> | ||||||
|  |         </init-param> | ||||||
|  |     </filter> | ||||||
|  | 
 | ||||||
|  |     <filter-mapping> | ||||||
|  |         <filter-name>wicket.examples</filter-name> | ||||||
|  |         <url-pattern>/*</url-pattern> | ||||||
|  |     </filter-mapping> | ||||||
|  | </web-app> | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user