Deleted individual projects for each example
This commit is contained in:
parent
0c1ad4f7c3
commit
9b52b7a3ef
@ -1,156 +0,0 @@
|
||||
<?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"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.wicket.examples</groupId>
|
||||
<artifactId>cafe-address</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>CafeAddress</name>
|
||||
<properties>
|
||||
<wicket.version>7.4.0</wicket.version>
|
||||
<jetty9.version>9.2.13.v20150730</jetty9.version>
|
||||
<log4j.version>2.5</log4j.version>
|
||||
<junit.version>4.12</junit.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<wtp.version>none</wtp.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- WICKET DEPENDENCIES -->
|
||||
<dependency>
|
||||
<groupId>org.apache.wicket</groupId>
|
||||
<artifactId>wicket-core</artifactId>
|
||||
<version>${wicket.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SPRING DEPENDENCIES -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>4.1.1.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.wicket</groupId>
|
||||
<artifactId>wicket-spring</artifactId>
|
||||
<version>8.0.0-M1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JUNIT DEPENDENCY FOR TESTING -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- JETTY DEPENDENCIES FOR TESTING -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
<artifactId>jetty-all</artifactId>
|
||||
<version>${jetty9.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>CafeAddress</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</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>
|
||||
<plugin>
|
||||
<inherited>true</inherited>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
<showWarnings>true</showWarnings>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>${jetty9.version}</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>maven.project.build.directory.test-classes</name>
|
||||
<value>${project.build.directory}/test-classes</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<jettyXml>${project.basedir}/src/test/jetty/jetty.xml,${project.basedir}/src/test/jetty/jetty-ssl.xml,${project.basedir}/src/test/jetty/jetty-http.xml,${project.basedir}/src/test/jetty/jetty-https.xml</jettyXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
<configuration>
|
||||
<downloadSources>true</downloadSources>
|
||||
<wtpversion>${wtp.version}</wtpversion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</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>
|
@ -1,10 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
public class ApplicationConfiguration {
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:wicket="http://wicket.apache.org">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Apache Wicket Quickstart</title>
|
||||
<link
|
||||
href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold'
|
||||
rel='stylesheet' type='text/css' />
|
||||
<link rel="stylesheet" href="style.css" type="text/css" media="screen"
|
||||
title="Stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 800px; margin: 0 auto;">
|
||||
<select wicket:id="cafes"></select>
|
||||
<p>
|
||||
Address: <span wicket:id="address">address</span>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,72 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.markup.html.form.DropDownChoice;
|
||||
import org.apache.wicket.model.PropertyModel;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
public class CafeAddress extends WebPage {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
String selectedCafe;
|
||||
Address address;
|
||||
Map<String, Address> cafeNamesAndAddresses = new HashMap<>();
|
||||
|
||||
public CafeAddress(final PageParameters parameters) {
|
||||
super(parameters);
|
||||
initCafes();
|
||||
|
||||
ArrayList<String> cafeNames = new ArrayList<>(this.cafeNamesAndAddresses.keySet());
|
||||
this.selectedCafe = cafeNames.get(0);
|
||||
this.address = new Address(this.cafeNamesAndAddresses.get(this.selectedCafe).getAddress());
|
||||
|
||||
final Label addressLabel = new Label("address", new PropertyModel<String>(this.address, "address"));
|
||||
addressLabel.setOutputMarkupId(true);
|
||||
|
||||
final DropDownChoice<String> cafeDropdown = new DropDownChoice<>("cafes", new PropertyModel<String>(this, "selectedCafe"), cafeNames);
|
||||
cafeDropdown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
protected void onUpdate(AjaxRequestTarget target) {
|
||||
String name = (String) cafeDropdown.getDefaultModel().getObject();
|
||||
address.setAddress(cafeNamesAndAddresses.get(name).getAddress());
|
||||
target.add(addressLabel);
|
||||
}
|
||||
});
|
||||
|
||||
add(addressLabel);
|
||||
add(cafeDropdown);
|
||||
|
||||
}
|
||||
|
||||
private void initCafes() {
|
||||
this.cafeNamesAndAddresses.put("Linda's Cafe", new Address("35 Bower St."));
|
||||
this.cafeNamesAndAddresses.put("Old Tree", new Address("2 Edgware Rd."));
|
||||
}
|
||||
|
||||
class Address implements Serializable {
|
||||
private String sAddress = "";
|
||||
|
||||
public Address(String address) {
|
||||
this.sAddress = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return this.sAddress;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.sAddress = address;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
import org.apache.wicket.protocol.http.WebApplication;
|
||||
|
||||
/**
|
||||
* Application object for your web application.
|
||||
* If you want to run this application without deploying, run the Start class.
|
||||
*
|
||||
* @see com.baeldung.wicket.examples.Start#main(String[])
|
||||
*/
|
||||
public class CafeAddressApplication extends WebApplication
|
||||
{
|
||||
/**
|
||||
* @see org.apache.wicket.Application#getHomePage()
|
||||
*/
|
||||
@Override
|
||||
public Class<? extends WebPage> getHomePage()
|
||||
{
|
||||
return CafeAddress.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.wicket.Application#init()
|
||||
*/
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
super.init();
|
||||
|
||||
// add your configuration here
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
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("CafeAddressApplication", WicketFilter.class);
|
||||
filter.setInitParameter("applicationClassName", CafeAddressApplication.class.getName());
|
||||
filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
|
||||
filter.addMappingForUrlPatterns(null, false, "/*");
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
@ -1,68 +0,0 @@
|
||||
body, p, li, a { font-family: georgia, times, serif;font-size:13pt;}
|
||||
h1, h2, h3 { font-family: 'Yanone Kaffeesatz', arial, serif; }
|
||||
body { margin:0;padding:0;}
|
||||
#hd {
|
||||
width : 100%;
|
||||
height : 87px;
|
||||
background-color : #092E67;
|
||||
margin-top : 0;
|
||||
padding-top : 10px;
|
||||
border-bottom : 1px solid #888;
|
||||
z-index : 0;
|
||||
}
|
||||
#ft {
|
||||
position : absolute;
|
||||
bottom : 0;
|
||||
width : 100%;
|
||||
height : 99px;
|
||||
background-color : #6493D2;
|
||||
border-top : 1px solid #888;
|
||||
z-index : 0;
|
||||
}
|
||||
#logo,#bd {
|
||||
width : 650px;
|
||||
margin: 0 auto;
|
||||
padding: 25px 50px 0 50px;
|
||||
}
|
||||
#logo h1 {
|
||||
color : white;
|
||||
font-size:36pt;
|
||||
display: inline;
|
||||
}
|
||||
#logo img {
|
||||
display:inline;
|
||||
vertical-align: bottom;
|
||||
margin-left : 50px;
|
||||
margin-right : 5px;
|
||||
}
|
||||
body { margin-top : 0; padding-top : 0;}
|
||||
#logo, #logo h1 { margin-top : 0; padding-top : 0;}
|
||||
#bd {
|
||||
position : absolute;
|
||||
top : 75px;
|
||||
bottom : 75px;
|
||||
left : 50%;
|
||||
margin-left : -325px;
|
||||
z-index : 1;
|
||||
overflow: auto;
|
||||
background-color : #fff;
|
||||
-webkit-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
-moz-box-shadow: 0px 0px 10px #888;
|
||||
-webkit-box-shadow: 0px 0px 10px #888;
|
||||
box-shadow: 0px 0px 10px #888;
|
||||
}
|
||||
a, a:visited, a:hover, a:active {
|
||||
color : #6493D2;
|
||||
}
|
||||
h2 {
|
||||
padding : 0; margin:0;
|
||||
font-size:36pt;
|
||||
color:#FF5500;
|
||||
}
|
||||
h3 {
|
||||
padding : 0; margin:0;
|
||||
font-size:24pt;
|
||||
color:#092E67;
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.SecureRequestCustomizer;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.SslConnectionFactory;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* Separate startup class for people that want to run the examples directly. Use parameter
|
||||
* -Dcom.sun.management.jmxremote to startup JMX (and e.g. connect with jconsole).
|
||||
*/
|
||||
public class Start {
|
||||
/**
|
||||
* Main function, starts the jetty server.
|
||||
*
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("wicket.configuration", "development");
|
||||
|
||||
Server server = new Server();
|
||||
|
||||
HttpConfiguration http_config = new HttpConfiguration();
|
||||
http_config.setSecureScheme("https");
|
||||
http_config.setSecurePort(8443);
|
||||
http_config.setOutputBufferSize(32768);
|
||||
|
||||
ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
|
||||
http.setPort(8080);
|
||||
http.setIdleTimeout(1000 * 60 * 60);
|
||||
|
||||
server.addConnector(http);
|
||||
|
||||
Resource keystore = Resource.newClassPathResource("/keystore");
|
||||
if (keystore != null && keystore.exists()) {
|
||||
// if a keystore for a SSL certificate is available, start a SSL
|
||||
// connector on port 8443.
|
||||
// By default, the quickstart comes with a Apache Wicket Quickstart
|
||||
// Certificate that expires about half way september 2021. Do not
|
||||
// use this certificate anywhere important as the passwords are
|
||||
// available in the source.
|
||||
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStoreResource(keystore);
|
||||
sslContextFactory.setKeyStorePassword("wicket");
|
||||
sslContextFactory.setKeyManagerPassword("wicket");
|
||||
|
||||
HttpConfiguration https_config = new HttpConfiguration(http_config);
|
||||
https_config.addCustomizer(new SecureRequestCustomizer());
|
||||
|
||||
ServerConnector https = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, "http/1.1"), new HttpConnectionFactory(https_config));
|
||||
https.setPort(8443);
|
||||
https.setIdleTimeout(500000);
|
||||
|
||||
server.addConnector(https);
|
||||
System.out.println("SSL access to the examples has been enabled on port 8443");
|
||||
System.out.println("You can access the application using SSL on https://localhost:8443");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
WebAppContext bb = new WebAppContext();
|
||||
bb.setServer(server);
|
||||
bb.setContextPath("/");
|
||||
bb.setWar("src/main/webapp");
|
||||
|
||||
// uncomment the next two lines if you want to start Jetty with WebSocket (JSR-356) support
|
||||
// you need org.apache.wicket:wicket-native-websocket-javax in the classpath!
|
||||
// ServerContainer serverContainer = WebSocketServerContainerInitializer.configureContext(bb);
|
||||
// serverContainer.addEndpoint(new WicketServerEndpointConfig());
|
||||
|
||||
// uncomment next line if you want to test with JSESSIONID encoded in the urls
|
||||
// ((AbstractSessionManager)
|
||||
// bb.getSessionHandler().getSessionManager()).setUsingCookies(false);
|
||||
|
||||
server.setHandler(bb);
|
||||
|
||||
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
|
||||
MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer);
|
||||
server.addEventListener(mBeanContainer);
|
||||
server.addBean(mBeanContainer);
|
||||
|
||||
try {
|
||||
server.start();
|
||||
server.join();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(100);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.baeldung.wicket.examples.cafeaddress;
|
||||
|
||||
import org.apache.wicket.util.tester.WicketTester;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Simple test using the WicketTester
|
||||
*/
|
||||
public class TestHomePage
|
||||
{
|
||||
private WicketTester tester;
|
||||
|
||||
@Before
|
||||
public void setUp()
|
||||
{
|
||||
tester = new WicketTester(new CafeAddressApplication());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void homepageRendersSuccessfully()
|
||||
{
|
||||
//start and render the test page
|
||||
tester.startPage(CafeAddress.class);
|
||||
|
||||
//assert rendered page class
|
||||
tester.assertRenderedPage(CafeAddress.class);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<!-- ============================================================= -->
|
||||
<!-- Configure the Jetty Server instance with an ID "Server" -->
|
||||
<!-- by adding a HTTP connector. -->
|
||||
<!-- This configuration must be used in conjunction with jetty.xml -->
|
||||
<!-- ============================================================= -->
|
||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
<!-- =========================================================== -->
|
||||
<!-- Add a HTTP Connector. -->
|
||||
<!-- Configure an o.e.j.server.ServerConnector with a single -->
|
||||
<!-- HttpConnectionFactory instance using the common httpConfig -->
|
||||
<!-- instance defined in jetty.xml -->
|
||||
<!-- -->
|
||||
<!-- Consult the javadoc of o.e.j.server.ServerConnector and -->
|
||||
<!-- o.e.j.server.HttpConnectionFactory for all configuration -->
|
||||
<!-- that may be set here. -->
|
||||
<!-- =========================================================== -->
|
||||
<Call name="addConnector">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.server.ServerConnector">
|
||||
<Arg name="server"><Ref refid="Server" /></Arg>
|
||||
<Arg name="factories">
|
||||
<Array type="org.eclipse.jetty.server.ConnectionFactory">
|
||||
<Item>
|
||||
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
|
||||
<Arg name="config"><Ref refid="httpConfig" /></Arg>
|
||||
</New>
|
||||
</Item>
|
||||
</Array>
|
||||
</Arg>
|
||||
<Set name="host"><Property name="jetty.host" /></Set>
|
||||
<Set name="port"><Property name="jetty.port" default="8080" /></Set>
|
||||
<Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Configure>
|
@ -1,45 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<!-- ============================================================= -->
|
||||
<!-- Configure a HTTPS connector. -->
|
||||
<!-- This configuration must be used in conjunction with jetty.xml -->
|
||||
<!-- and jetty-ssl.xml. -->
|
||||
<!-- ============================================================= -->
|
||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
<!-- =========================================================== -->
|
||||
<!-- Add a HTTPS Connector. -->
|
||||
<!-- Configure an o.e.j.server.ServerConnector with connection -->
|
||||
<!-- factories for TLS (aka SSL) and HTTP to provide HTTPS. -->
|
||||
<!-- All accepted TLS connections are wired to a HTTP connection.-->
|
||||
<!-- -->
|
||||
<!-- Consult the javadoc of o.e.j.server.ServerConnector, -->
|
||||
<!-- o.e.j.server.SslConnectionFactory and -->
|
||||
<!-- o.e.j.server.HttpConnectionFactory for all configuration -->
|
||||
<!-- that may be set here. -->
|
||||
<!-- =========================================================== -->
|
||||
<Call id="httpsConnector" name="addConnector">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.server.ServerConnector">
|
||||
<Arg name="server"><Ref refid="Server" /></Arg>
|
||||
<Arg name="factories">
|
||||
<Array type="org.eclipse.jetty.server.ConnectionFactory">
|
||||
<Item>
|
||||
<New class="org.eclipse.jetty.server.SslConnectionFactory">
|
||||
<Arg name="next">http/1.1</Arg>
|
||||
<Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
|
||||
</New>
|
||||
</Item>
|
||||
<Item>
|
||||
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
|
||||
<Arg name="config"><Ref refid="sslHttpConfig"/></Arg>
|
||||
</New>
|
||||
</Item>
|
||||
</Array>
|
||||
</Arg>
|
||||
<Set name="host"><Property name="jetty.host" /></Set>
|
||||
<Set name="port"><Property name="jetty.https.port" default="8443" /></Set>
|
||||
<Set name="idleTimeout">30000</Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Configure>
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<!-- ============================================================= -->
|
||||
<!-- Configure a TLS (SSL) Context Factory -->
|
||||
<!-- This configuration must be used in conjunction with jetty.xml -->
|
||||
<!-- and either jetty-https.xml or jetty-spdy.xml (but not both) -->
|
||||
<!-- ============================================================= -->
|
||||
<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
|
||||
<Set name="KeyStorePath"><Property name="maven.project.build.directory.test-classes" default="." />/<Property name="jetty.keystore" default="keystore"/></Set>
|
||||
<Set name="KeyStorePassword"><Property name="jetty.keystore.password" default="wicket"/></Set>
|
||||
<Set name="KeyManagerPassword"><Property name="jetty.keymanager.password" default="wicket"/></Set>
|
||||
<Set name="EndpointIdentificationAlgorithm"></Set>
|
||||
<Set name="ExcludeCipherSuites">
|
||||
<Array type="String">
|
||||
<Item>SSL_RSA_WITH_DES_CBC_SHA</Item>
|
||||
<Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item>
|
||||
<Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item>
|
||||
<Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item>
|
||||
<Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
|
||||
<Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
|
||||
<Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item>
|
||||
</Array>
|
||||
</Set>
|
||||
<!-- =========================================================== -->
|
||||
<!-- Create a TLS specific HttpConfiguration based on the -->
|
||||
<!-- common HttpConfiguration defined in jetty.xml -->
|
||||
<!-- Add a SecureRequestCustomizer to extract certificate and -->
|
||||
<!-- session information -->
|
||||
<!-- =========================================================== -->
|
||||
<New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
|
||||
<Arg><Ref refid="httpConfig"/></Arg>
|
||||
<Call name="addCustomizer">
|
||||
<Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
|
||||
</Call>
|
||||
</New>
|
||||
</Configure>
|
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<!-- ============================================================= -->
|
||||
<!-- Configure a HTTP connector. -->
|
||||
<!-- ============================================================= -->
|
||||
<Configure>
|
||||
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
|
||||
<Set name="secureScheme">https</Set>
|
||||
<Set name="securePort">
|
||||
<Property name="jetty.secure.port" default="8443" />
|
||||
</Set>
|
||||
<Set name="outputBufferSize">32768</Set>
|
||||
<Set name="requestHeaderSize">8192</Set>
|
||||
<Set name="responseHeaderSize">8192</Set>
|
||||
<Set name="sendServerVersion">true</Set>
|
||||
<Set name="sendDateHeader">false</Set>
|
||||
<Set name="headerCacheSize">512</Set>
|
||||
|
||||
<!-- Uncomment to enable handling of X-Forwarded- style headers <Call name="addCustomizer"> -->
|
||||
<!-- <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg> -->
|
||||
<!-- </Call> -->
|
||||
</New>
|
||||
</Configure>
|
Binary file not shown.
@ -1,60 +0,0 @@
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.wicket.examples</groupId>
|
||||
<artifactId>hello-world</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>HelloWorld</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.wicket</groupId>
|
||||
<artifactId>wicket-core</artifactId>
|
||||
<version>8.0.0-M1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>4.1.1.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.wicket</groupId>
|
||||
<artifactId>wicket-spring</artifactId>
|
||||
<version>8.0.0-M1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>HelloWorld</finalName>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -1,10 +0,0 @@
|
||||
package com.baeldung.wicket.examples.helloworld;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
public class ApplicationConfiguration {
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<span wicket:id="hello"></span>
|
||||
</body>
|
||||
</html>
|
@ -1,10 +0,0 @@
|
||||
package com.baeldung.wicket.examples.helloworld;
|
||||
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
|
||||
public class HelloWorld extends WebPage {
|
||||
public HelloWorld() {
|
||||
add(new Label("hello", "Hello World!"));
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
|
||||
package com.baeldung.wicket.examples.helloworld;
|
||||
|
||||
import org.apache.wicket.Page;
|
||||
import org.apache.wicket.protocol.http.WebApplication;
|
||||
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
public class HelloWorldApplication extends WebApplication {
|
||||
@Override
|
||||
public Class<? extends Page> getHomePage() {
|
||||
return HelloWorld.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
|
||||
}
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.baeldung.wicket.examples.helloworld;
|
||||
|
||||
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("HelloWorldApplication", WicketFilter.class);
|
||||
filter.setInitParameter("applicationClassName", HelloWorldApplication.class.getName());
|
||||
filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
|
||||
filter.addMappingForUrlPatterns(null, false, "/*");
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user