Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project
|
@ -2,21 +2,30 @@
|
|||
.classpath
|
||||
.project
|
||||
.settings
|
||||
.gitignore
|
||||
|
||||
# maven
|
||||
target/
|
||||
*/src/main/java/META-INF/
|
||||
*.versionsBackup
|
||||
*.releaseBackup
|
||||
bin/
|
||||
|
||||
# common junk
|
||||
*.log
|
||||
*.swp
|
||||
*.diff
|
||||
*.patch
|
||||
*.sw[a-p]
|
||||
*.bak
|
||||
*.backup
|
||||
*.debug
|
||||
*.dump
|
||||
|
||||
# intellij
|
||||
# vim
|
||||
.*.sw[a-p]
|
||||
*~
|
||||
~*
|
||||
|
||||
# intellij / android studio
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
@ -32,12 +41,9 @@ bin/
|
|||
# netbeans
|
||||
/nbproject
|
||||
|
||||
# vim
|
||||
.*.sw[a-p]
|
||||
|
||||
# merge tooling
|
||||
*.orig
|
||||
|
||||
#maven
|
||||
*.versionsBackup
|
||||
*.releaseBackup
|
||||
# test generated content
|
||||
*/src/test/*/WEB-INF/lib/test*.jar
|
||||
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
Contributing to Jetty
|
||||
=====================
|
||||
Thanks for your interest in this project.
|
||||
|
||||
Project description
|
||||
--------------------
|
||||
Jetty is a lightweight highly scalable java based web server and servlet engine.
|
||||
Our goal is to support web protocols like HTTP, HTTP/2, and WebSocket in a high
|
||||
volume low latency way that provides maximum performance while retaining the ease
|
||||
of use and compatibility with years of servlet development.
|
||||
Jetty is a modern fully async web server that has a long history as a component
|
||||
oriented technology easily embedded into applications while still offering a solid
|
||||
traditional distribution for webapp deployment.
|
||||
|
||||
- [https://projects.eclipse.org/projects/rt.jetty](https://projects.eclipse.org/projects/rt.jetty)
|
||||
|
||||
Developer resources
|
||||
--------------------
|
||||
Information regarding source code management, builds, coding standards, and more.
|
||||
|
||||
- [https://www.eclipse.org/jetty/documentation/current/advanced-contributing.html](https://www.eclipse.org/jetty/documentation/current/advanced-contributing.html)
|
||||
|
||||
The canonical Jetty git repository is located at git.eclipse.org and we are unable
|
||||
to directly merge pull requests into the GitHub mirrored repository.
|
||||
Providing you have completed the contributors agreement mentioned below we will
|
||||
endeavor to pull your commit into Jetty proper.
|
||||
|
||||
Contributor License Agreement
|
||||
------------------------------
|
||||
Before your contribution can be accepted by the project, you need to create and electronically sign the
|
||||
Eclipse Foundation [Contributor License Agreement](https://www.eclipse.org/legal/CLA.php) (CLA):
|
||||
|
||||
1. Log in to the [Eclipse projects forge](https://projects.eclipse.org/user/login/sso). You will need to
|
||||
create an account with the Eclipse Foundation if you have not already done so.
|
||||
2. Click on "Contributor License Agreement", and complete the form.
|
||||
|
||||
Be sure to use the same email address in your Eclipse account that you intend to use when you commit to Git.
|
||||
|
||||
Contact
|
||||
--------
|
||||
Contact the project developers via the project's "dev" list.
|
||||
|
||||
- [https://dev.eclipse.org/mailman/listinfo/jetty-dev](https://dev.eclipse.org/mailman/listinfo/jetty-dev)
|
||||
|
||||
Search for bugs
|
||||
----------------
|
||||
This project uses Bugzilla to track ongoing development and issues.
|
||||
|
||||
- [https://bugs.eclipse.org/bugs/buglist.cgi?product=Jetty](https://bugs.eclipse.org/bugs/buglist.cgi?product=Jetty)
|
||||
|
||||
Create a new bug
|
||||
-----------------
|
||||
Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!
|
||||
|
||||
- [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty)
|
97
NOTICE.txt
|
@ -1,6 +1,6 @@
|
|||
==============================================================
|
||||
Jetty Web Container
|
||||
Copyright 1995-2014 Mort Bay Consulting Pty Ltd.
|
||||
Copyright 1995-2015 Mort Bay Consulting Pty Ltd.
|
||||
==============================================================
|
||||
|
||||
The Jetty Web Container is Copyright Mort Bay Consulting Pty Ltd
|
||||
|
@ -18,9 +18,97 @@ Jetty is dual licensed under both
|
|||
|
||||
Jetty may be distributed under either license.
|
||||
|
||||
The javax.servlet package used was sourced from the Apache
|
||||
Software Foundation and is distributed under the apache 2.0
|
||||
license.
|
||||
------
|
||||
Eclipse
|
||||
|
||||
The following artifacts are EPL.
|
||||
* org.eclipse.jetty.orbit:org.eclipse.jdt.core
|
||||
|
||||
The following artifacts are EPL and ASL2.
|
||||
* org.eclipse.jetty.orbit:javax.security.auth.message
|
||||
|
||||
|
||||
The following artifacts are EPL and CDDL 1.0.
|
||||
* org.eclipse.jetty.orbit:javax.mail.glassfish
|
||||
|
||||
|
||||
------
|
||||
Oracle
|
||||
|
||||
The following artifacts are CDDL + GPLv2 with classpath exception.
|
||||
https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html
|
||||
|
||||
* javax.servlet:javax.servlet-api
|
||||
* javax.annotation:javax.annotation-api
|
||||
* javax.transaction:javax.transaction-api
|
||||
* javax.websocket:javax.websocket-api
|
||||
|
||||
------
|
||||
Oracle OpenJDK
|
||||
|
||||
If ALPN is used to negotiate HTTP/2 connections, then the following
|
||||
artifacts may be included in the distribution or downloaded when ALPN
|
||||
module is selected.
|
||||
|
||||
* java.sun.security.ssl
|
||||
|
||||
These artifacts replace/modify OpenJDK classes. The modififications
|
||||
are hosted at github and both modified and original are under GPL v2 with
|
||||
classpath exceptions.
|
||||
http://openjdk.java.net/legal/gplv2+ce.html
|
||||
|
||||
|
||||
------
|
||||
OW2
|
||||
|
||||
The following artifacts are licensed by the OW2 Foundation according to the
|
||||
terms of http://asm.ow2.org/license.html
|
||||
|
||||
org.ow2.asm:asm-commons
|
||||
org.ow2.asm:asm
|
||||
|
||||
|
||||
------
|
||||
Apache
|
||||
|
||||
The following artifacts are ASL2 licensed.
|
||||
|
||||
org.apache.taglibs:taglibs-standard-spec
|
||||
org.apache.taglibs:taglibs-standard-impl
|
||||
|
||||
|
||||
------
|
||||
MortBay
|
||||
|
||||
The following artifacts are ASL2 licensed. Based on selected classes from
|
||||
following Apache Tomcat jars, all ASL2 licensed.
|
||||
|
||||
org.mortbay.jasper:apache-jsp
|
||||
org.apache.tomcat:tomcat-jasper
|
||||
org.apache.tomcat:tomcat-juli
|
||||
org.apache.tomcat:tomcat-jsp-api
|
||||
org.apache.tomcat:tomcat-el-api
|
||||
org.apache.tomcat:tomcat-jasper-el
|
||||
org.apache.tomcat:tomcat-api
|
||||
org.apache.tomcat:tomcat-util-scan
|
||||
org.apache.tomcat:tomcat-util
|
||||
|
||||
org.mortbay.jasper:apache-el
|
||||
org.apache.tomcat:tomcat-jasper-el
|
||||
org.apache.tomcat:tomcat-el-api
|
||||
|
||||
|
||||
------
|
||||
Mortbay
|
||||
|
||||
The following artifacts are CDDL + GPLv2 with classpath exception.
|
||||
|
||||
https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html
|
||||
|
||||
org.eclipse.jetty.toolchain:jetty-schemas
|
||||
|
||||
------
|
||||
Assorted
|
||||
|
||||
The UnixCrypt.java code implements the one way cryptography used by
|
||||
Unix systems for simple password protection. Copyright 1996 Aki Yoshida,
|
||||
|
@ -28,4 +116,3 @@ modified April 2001 by Iris Van den Broeke, Daniel Deville.
|
|||
Permission to use, copy, modify and distribute UnixCrypt
|
||||
for non-commercial or commercial purposes and without fee is
|
||||
granted provided that the copyright notice appears in all copies.
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
This is a source checkout of the Jetty webserver.
|
||||
|
||||
This is a source checkout of the Eclipse Jetty webserver.
|
||||
|
||||
To build, use:
|
||||
|
||||
|
@ -19,4 +18,3 @@ for the tests to all pass successfully.
|
|||
Bypass tests by building with -Dmaven.test.skip=true but note
|
||||
that this will not produce some test jars that are leveraged
|
||||
in other places in the build.
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
Project description
|
||||
============
|
||||
|
||||
Jetty is a lightweight highly scalable java based web server and servlet engine.
|
||||
Our goal is to support web protocols like HTTP, HTTP/2 and WebSocket in a high
|
||||
volume low latency way that provides maximum performance while retaining the ease
|
||||
of use and compatibility with years of servlet development. Jetty is a modern
|
||||
fully async web server that has a long history as a component oriented technology
|
||||
easily embedded into applications while still offering a solid traditional
|
||||
distribution for webapp deployment.
|
||||
|
||||
- [https://projects.eclipse.org/projects/rt.jetty](https://projects.eclipse.org/projects/rt.jetty)
|
||||
|
||||
Documentation
|
||||
============
|
||||
|
||||
Project documentation is located on our Eclipse website.
|
||||
|
||||
- [http://www.eclipse.org/jetty/documentation](http://www.eclipse.org/jetty/documentation)
|
||||
|
||||
Professional Services
|
||||
============
|
||||
|
||||
Expert advice and production support are available through [http://webtide.com](Webtide.com).
|
1323
VERSION.txt
|
@ -0,0 +1,125 @@
|
|||
HttpParser Error Buffer Bleed Vulnerability
|
||||
===========================================
|
||||
|
||||
Published Date:
|
||||
---------------
|
||||
|
||||
2015, Feb 24
|
||||
|
||||
CVE:
|
||||
----
|
||||
|
||||
CVE-2015-2080
|
||||
|
||||
Discovered and Reported By:
|
||||
---------------------------
|
||||
|
||||
[Gotham Digital Science](http://www.gdssecurity.com/) and Stephen Komal.
|
||||
|
||||
[JetLeak Vulnerability Remote Leakage of Shared Buffers in Jetty / blogs.gdsecurity.com](http://blog.gdssecurity.com/labs/2015/2/25/jetleak-vulnerability-remote-leakage-of-shared-buffers-in-je.html)
|
||||
|
||||
|
||||
Affected Versions of Jetty:
|
||||
---------------------------
|
||||
|
||||
* 9.2.3.v20140905
|
||||
* 9.2.4.v20141103
|
||||
* 9.2.5.v20141112
|
||||
* 9.2.6.v20141205
|
||||
* 9.2.7.v20150116
|
||||
* 9.2.8.v20150217
|
||||
* 9.3.0.M0
|
||||
* 9.3.0.M1
|
||||
|
||||
Versions of Jetty Containing Fix:
|
||||
--------------------------------
|
||||
|
||||
* 9.2.9.v20150224
|
||||
|
||||
Patched version of jetty-http.jar:
|
||||
----------------------------------
|
||||
|
||||
Patched version of the affected jetty-http jars are available as attachments on https://bugs.eclipse.org/460642
|
||||
|
||||
Statement:
|
||||
----------
|
||||
|
||||
Jetty versions 9.2.3.v20140905 through 9.2.8.v20150217 have a ByteBuffer reuse and information bleed vulnerability surrounding bad HTTP request header parsing error responses.
|
||||
|
||||
History:
|
||||
--------
|
||||
|
||||
Back in Jetty 9.2.3, a feature requesting more detailed logging messages surrounding problems parsing bad HTTP request headers ( https://bugs.eclipse.org/443049 ) was implemented.
|
||||
|
||||
The feature request was to include better debug information in the Jetty logs (at WARN level) to help diagnose and resolve HTTP parsing errors.
|
||||
|
||||
However, the implementation incorrectly exposes this debug information back on the HTTP 400 response reason phrase, potentially exposing parts of server side buffers used from prior request processing on the same server.
|
||||
|
||||
The following bash shell script demonstrates the problem using netcat on linux against the Jetty Distribution's demo-base.
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
RESOURCEPATH="/test/dump/info"
|
||||
BAD=$'\a'
|
||||
|
||||
function normalRequest {
|
||||
echo "-- Normal Request --"
|
||||
|
||||
nc localhost 8080 << NORMREQ
|
||||
POST $RESOURCEPATH HTTP/1.1
|
||||
Host: localhost
|
||||
Content-Type: application/x-www-form-urlencoded;charset=utf-8
|
||||
Connection: close
|
||||
Content-Length: 16
|
||||
|
||||
Username=Joakim
|
||||
NORMREQ
|
||||
}
|
||||
|
||||
function badCookie {
|
||||
echo "-- Bad Cookie --"
|
||||
|
||||
nc localhost 8080 << BADCOOKIE
|
||||
GET $RESOURCEPATH HTTP/1.1
|
||||
Host: localhost
|
||||
Coo${BAD}kie: ${BAD}
|
||||
|
||||
BADCOOKIE
|
||||
}
|
||||
|
||||
normalRequest
|
||||
echo ""
|
||||
echo ""
|
||||
badCookie
|
||||
```
|
||||
|
||||
The results are often seen in the HTTP response such as ...
|
||||
|
||||
```
|
||||
HTTP/1.1 400 Illegal character 0x7 in state=HEADER_IN_NAME in 'GET /dummy/ HTTP/... localhost\nCoo\x07<<<kie: \x07\n\n>>>e: application/x-...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Content-Length: 0
|
||||
Connection: close
|
||||
Server: Jetty(9.2.8.v20150217)
|
||||
```
|
||||
|
||||
What you are seeing is a http response phrase that includes raw ByteBuffer details on what happened during the parsing failure.
|
||||
|
||||
The parts of the output are in the general form
|
||||
`{what_has_been_parsed}<<<{left_to_parse}>>>{old_buffer_seen_past_limit}`
|
||||
|
||||
The part at `{old_buffer_seen_past_limit}` is where this exposure of past buffers comes from. It is this information where an exploit could be made to present random prior buffers from the server buffer pool. This information can contain anything seen in a past handled request.
|
||||
|
||||
We have this problem already patched in Jetty 9.2.9.v20150224, and the same test as above results in ...
|
||||
|
||||
```
|
||||
HTTP/1.1 400 Illegal character 0x7
|
||||
Content-Length: 0
|
||||
Connection: close
|
||||
Server: Jetty(9.2.9.v20150224)
|
||||
```
|
||||
|
||||
Everyone is strongly encouraged to upgrade to Jetty 9.2.9.v20150224 immediately.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
<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">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
<artifactId>jetty-all-compact3</artifactId>
|
||||
<name>Jetty :: Aggregate :: All core Jetty suitable for Java 8 compact 3 profile</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.all.compact3</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<sourceDirectory>${project.build.directory}/sources</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
<compilerArgs>
|
||||
<arg>-profile</arg>
|
||||
<arg>compact3</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-dependencies</id>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>**/MANIFEST.MF,javax/**</excludes>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classifier>sources</classifier>
|
||||
<includes>**/*</includes>
|
||||
<excludes>
|
||||
META-INF/**
|
||||
**/Servlet3Continuation*
|
||||
**/Jetty6Continuation*
|
||||
**/AppContextLeakPreventer*.java
|
||||
**/AWTLeakPreventer*.java
|
||||
**/IntrospectorCleaner*.java
|
||||
**/PostConstructAnnotationHandler*.java
|
||||
**/PreDestroyAnnotationHandler*.java
|
||||
**/ResourceAnnotationHandler*.java
|
||||
**/ResourcesAnnotationHandler*.java
|
||||
</excludes>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/sources</outputDirectory>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins
|
||||
</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<mode>development</mode>
|
||||
<url>http://eclipse.org/jetty</url>
|
||||
<Built-By>${user.name}</Built-By>
|
||||
<package>org.eclipse.jetty</package>
|
||||
<Bundle-License>http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/NOTICE.txt</Bundle-License>
|
||||
<Bundle-Name>Jetty</Bundle-Name>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc-jar</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-deploy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaspi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jndi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-quickstart</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- dependencies that jetty-all needs (some optional) -->
|
||||
<dependency>
|
||||
<groupId>javax.websocket</groupId>
|
||||
<artifactId>javax.websocket-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>javax.transaction-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -2,108 +2,124 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.1.3-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
<artifactId>jetty-all</artifactId>
|
||||
<name>Jetty :: Aggregate :: All core Jetty</name>
|
||||
<description>UberJar for Core Jetty features</description>
|
||||
<packaging>pom</packaging>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<uber-jar>${project.build.directory}/${project.artifactId}-${project.version}-uber.jar</uber-jar>
|
||||
<gen-resources-dir>${project.build.directory}/gen-resources</gen-resources-dir>
|
||||
</properties>
|
||||
<build>
|
||||
<sourceDirectory>${project.build.directory}/sources</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-dependencies</id>
|
||||
<id>massage-manifest</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>**/MANIFEST.MF,javax/**</excludes>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.npn,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classifier>sources</classifier>
|
||||
<includes>**/*</includes>
|
||||
<excludes>META-INF/**,**/Servlet3Continuation*,**/Jetty6Continuation*</excludes>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.npn,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/sources</outputDirectory>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins
|
||||
</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<mode>development</mode>
|
||||
<url>http://eclipse.org/jetty</url>
|
||||
<Built-By>${user.name}</Built-By>
|
||||
<package>org.eclipse.jetty</package>
|
||||
<Bundle-License>http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/NOTICE.txt</Bundle-License>
|
||||
<Bundle-Name>Jetty</Bundle-Name>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
<outputDirectory>${gen-resources-dir}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-build-support</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc-jar</id>
|
||||
<phase>compile</phase>
|
||||
<id>uberjar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedClassifierName>uber</shadedClassifierName>
|
||||
<outputFile>${uber-jar}</outputFile>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.eclipse.jetty.toolchain.shade.IncludeDirectoryTransformer">
|
||||
<directory>${gen-resources-dir}</directory>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/LICENSE.txt</exclude>
|
||||
<exclude>META-INF/*.MF</exclude>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<artifactSet>
|
||||
<excludes>
|
||||
<exclude>javax:*</exclude>
|
||||
<exclude>org.eclipse.jetty.orbit:*</exclude>
|
||||
<exclude>org.mortbay.jetty:*</exclude>
|
||||
<exclude>org.mortbay.jetty.alpn:*</exclude>
|
||||
<exclude>org.slf4j:*</exclude>
|
||||
<exclude>org.ow2.asm:*</exclude>
|
||||
<exclude>*:javax</exclude>
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-artifacts</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>${uber-jar}</file>
|
||||
<type>jar</type>
|
||||
<classifier>uber</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
@ -111,114 +127,109 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-deploy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaspi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jndi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-quickstart</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- websocket support -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- http/2 support -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- dependencies that jetty-all needs (some optional) -->
|
||||
<dependency>
|
||||
<groupId>javax.websocket</groupId>
|
||||
<artifactId>javax.websocket-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>javax.transaction-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
mode: development
|
||||
Implementation-Title: Jetty Uber All
|
||||
Implementation-Vendor: Eclipse Jetty Project
|
||||
Implementation-Vendor-Id: org.eclipse.jetty
|
||||
Implementation-Version: @project.version@
|
||||
X-License: https://www.eclipse.org/jetty/licenses.php
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications.
|
||||
|
||||
1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
|
||||
|
||||
1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
|
||||
|
||||
1.4. Executable. means the Covered Software in any form other than Source Code.
|
||||
|
||||
1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License.
|
||||
|
||||
1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.7. License. means this document.
|
||||
|
||||
1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. Modifications. means the Source Code and Executable form of any of the following:
|
||||
|
||||
A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
|
||||
|
||||
B. Any new file that contains any part of the Original Software or previous Modification; or
|
||||
|
||||
C. Any new file that is contributed or otherwise made available under the terms of this License.
|
||||
|
||||
1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License.
|
||||
|
||||
1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
|
||||
|
||||
1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. License Grants.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
|
||||
|
||||
(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
|
||||
|
||||
(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Availability of Source Code.
|
||||
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
3.2. Modifications.
|
||||
The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
|
||||
|
||||
3.3. Required Notices.
|
||||
You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
|
||||
|
||||
3.4. Application of Additional Terms.
|
||||
You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.5. Distribution of Executable Versions.
|
||||
You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
|
||||
|
||||
3.6. Larger Works.
|
||||
You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
|
||||
|
||||
4. Versions of the License.
|
||||
|
||||
4.1. New Versions.
|
||||
Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
|
||||
|
||||
4.2. Effect of New Versions.
|
||||
You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
|
||||
|
||||
4.3. Modified Versions.
|
||||
When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
|
||||
|
||||
5. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
6. TERMINATION.
|
||||
|
||||
6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
|
||||
|
||||
6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
|
||||
|
||||
6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
|
||||
|
||||
7. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
8. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
|
||||
|
||||
9. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
|
||||
|
||||
10. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
|
||||
|
||||
NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
|
||||
|
||||
The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
|
||||
|
||||
|
||||
The GNU General Public License (GPL) Version 2, June 1991
|
||||
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
|
||||
|
||||
Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words
|
||||
|
||||
"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version.
|
|
@ -0,0 +1,263 @@
|
|||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications.
|
||||
|
||||
1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
|
||||
|
||||
1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
|
||||
|
||||
1.4. Executable. means the Covered Software in any form other than Source Code.
|
||||
|
||||
1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License.
|
||||
|
||||
1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.7. License. means this document.
|
||||
|
||||
1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. Modifications. means the Source Code and Executable form of any of the following:
|
||||
|
||||
A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
|
||||
|
||||
B. Any new file that contains any part of the Original Software or previous Modification; or
|
||||
|
||||
C. Any new file that is contributed or otherwise made available under the terms of this License.
|
||||
|
||||
1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License.
|
||||
|
||||
1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
|
||||
|
||||
1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. License Grants.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
|
||||
|
||||
(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
|
||||
|
||||
(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Availability of Source Code.
|
||||
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
3.2. Modifications.
|
||||
The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
|
||||
|
||||
3.3. Required Notices.
|
||||
You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
|
||||
|
||||
3.4. Application of Additional Terms.
|
||||
You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.5. Distribution of Executable Versions.
|
||||
You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
|
||||
|
||||
3.6. Larger Works.
|
||||
You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
|
||||
|
||||
4. Versions of the License.
|
||||
|
||||
4.1. New Versions.
|
||||
Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
|
||||
|
||||
4.2. Effect of New Versions.
|
||||
You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
|
||||
|
||||
4.3. Modified Versions.
|
||||
When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
|
||||
|
||||
5. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
6. TERMINATION.
|
||||
|
||||
6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
|
||||
|
||||
6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
|
||||
|
||||
6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
|
||||
|
||||
7. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
8. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
|
||||
|
||||
9. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
|
||||
|
||||
10. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
|
||||
|
||||
NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
|
||||
|
||||
The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
|
||||
|
||||
|
||||
The GNU General Public License (GPL) Version 2, June 1991
|
||||
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
|
||||
|
||||
Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words
|
||||
|
||||
"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version.
|
|
@ -0,0 +1,263 @@
|
|||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications.
|
||||
|
||||
1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
|
||||
|
||||
1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
|
||||
|
||||
1.4. Executable. means the Covered Software in any form other than Source Code.
|
||||
|
||||
1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License.
|
||||
|
||||
1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.7. License. means this document.
|
||||
|
||||
1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. Modifications. means the Source Code and Executable form of any of the following:
|
||||
|
||||
A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
|
||||
|
||||
B. Any new file that contains any part of the Original Software or previous Modification; or
|
||||
|
||||
C. Any new file that is contributed or otherwise made available under the terms of this License.
|
||||
|
||||
1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License.
|
||||
|
||||
1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
|
||||
|
||||
1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. License Grants.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
|
||||
|
||||
(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
|
||||
|
||||
(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Availability of Source Code.
|
||||
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
3.2. Modifications.
|
||||
The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
|
||||
|
||||
3.3. Required Notices.
|
||||
You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
|
||||
|
||||
3.4. Application of Additional Terms.
|
||||
You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.5. Distribution of Executable Versions.
|
||||
You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
|
||||
|
||||
3.6. Larger Works.
|
||||
You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
|
||||
|
||||
4. Versions of the License.
|
||||
|
||||
4.1. New Versions.
|
||||
Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
|
||||
|
||||
4.2. Effect of New Versions.
|
||||
You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
|
||||
|
||||
4.3. Modified Versions.
|
||||
When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
|
||||
|
||||
5. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
6. TERMINATION.
|
||||
|
||||
6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
|
||||
|
||||
6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
|
||||
|
||||
6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
|
||||
|
||||
7. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
8. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
|
||||
|
||||
9. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
|
||||
|
||||
10. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
|
||||
|
||||
NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
|
||||
|
||||
The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
|
||||
|
||||
|
||||
The GNU General Public License (GPL) Version 2, June 1991
|
||||
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
|
||||
Copyright (C)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
|
||||
|
||||
"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
|
||||
|
||||
Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words
|
||||
|
||||
"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code."
|
||||
|
||||
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination.
|
||||
|
||||
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module.? An independent module is a module which is not derived from or based on this library.? If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so.? If you do not wish to do so, delete this exception statement from your version.
|
|
@ -42,7 +42,7 @@
|
|||
<excludes>META-INF/**,**/Servlet3Continuation*,**/Jetty6Continuation*</excludes>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.npn</excludeGroupIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.alpn</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/sources</outputDirectory>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
<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">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<name>Jetty :: Apache JSP Implementation</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.${project.artifactId}</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Description>Jetty-specific ServletContainerInitializer for Jasper</Bundle-Description>
|
||||
<Export-Package>org.eclipse.jetty.apache.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
org.eclipse.jetty.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer</Provide-Capability>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Schemas -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-schemas</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- servlet api -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JSP Impl -->
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jasper</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Eclipse Java Compiler (for JSP Compilation) -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
||||
<artifactId>ecj</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
[description]
|
||||
Enables use of the apache implementation of JSP
|
||||
|
||||
[name]
|
||||
apache-jsp
|
||||
|
||||
[lib]
|
||||
lib/apache-jsp/*.jar
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.apache.jsp;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.jasper.servlet.JasperInitializer;
|
||||
import org.apache.jasper.servlet.TldPreScanned;
|
||||
import org.apache.jasper.servlet.TldScanner;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* JettyJasperInitializer
|
||||
*/
|
||||
public class JettyJasperInitializer extends JasperInitializer
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JettyJasperInitializer.class);
|
||||
|
||||
/**
|
||||
* NullTldScanner
|
||||
*
|
||||
* Does nothing. Used when we can tell that all jsps have been precompiled, in which case
|
||||
* the tlds are not needed.
|
||||
*/
|
||||
private final class NullTldScanner extends TldScanner
|
||||
{
|
||||
/**
|
||||
* @param context
|
||||
* @param namespaceAware
|
||||
* @param validation
|
||||
* @param blockExternal
|
||||
*/
|
||||
private NullTldScanner(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal)
|
||||
{
|
||||
super(context, namespaceAware, validation, blockExternal);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.jasper.servlet.TldScanner#scan()
|
||||
*/
|
||||
@Override
|
||||
public void scan() throws IOException, SAXException
|
||||
{
|
||||
return; //do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.jasper.servlet.TldScanner#getListeners()
|
||||
*/
|
||||
@Override
|
||||
public List<String> getListeners()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.jasper.servlet.TldScanner#scanJars()
|
||||
*/
|
||||
@Override
|
||||
public void scanJars()
|
||||
{
|
||||
return; //do nothing
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a TldScanner, and prefeed it the tlds that have already been discovered in jar files
|
||||
* by the MetaInfConfiguration.
|
||||
*/
|
||||
@Override
|
||||
public TldScanner newTldScanner(ServletContext context, boolean namespaceAware, boolean validate, boolean blockExternal)
|
||||
{
|
||||
String tmp = context.getInitParameter("org.eclipse.jetty.jsp.precompiled");
|
||||
if (tmp!=null && !tmp.equals("") && Boolean.valueOf(tmp))
|
||||
{
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Jsp precompilation detected");
|
||||
return new NullTldScanner(context, namespaceAware, validate, blockExternal);
|
||||
}
|
||||
|
||||
Collection<URL> tldUrls = (Collection<URL>)context.getAttribute("org.eclipse.jetty.tlds");
|
||||
if (tldUrls != null)
|
||||
{
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Tld pre-scan detected");
|
||||
return new TldPreScanned(context,namespaceAware,validate,blockExternal,tldUrls);
|
||||
}
|
||||
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Defaulting to jasper tld scanning");
|
||||
return super.newTldScanner(context, namespaceAware, validate, blockExternal);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,188 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.apache.jsp;
|
||||
|
||||
public class JuliLog implements org.apache.juli.logging.Log
|
||||
{
|
||||
public static org.apache.juli.logging.Log getInstance(String name)
|
||||
{
|
||||
return new JuliLog(name);
|
||||
}
|
||||
|
||||
private final org.eclipse.jetty.util.log.Logger _logger;
|
||||
private final org.eclipse.jetty.util.log.StdErrLog _stdErrLog;
|
||||
|
||||
public JuliLog()
|
||||
{
|
||||
_logger=org.eclipse.jetty.util.log.Log.getRootLogger();
|
||||
_stdErrLog=(_logger instanceof org.eclipse.jetty.util.log.StdErrLog) ? (org.eclipse.jetty.util.log.StdErrLog)_logger:null;
|
||||
}
|
||||
|
||||
public JuliLog(String name)
|
||||
{
|
||||
_logger=org.eclipse.jetty.util.log.Log.getLogger(name);
|
||||
_stdErrLog=(_logger instanceof org.eclipse.jetty.util.log.StdErrLog) ? (org.eclipse.jetty.util.log.StdErrLog)_logger:null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDebugEnabled()
|
||||
{
|
||||
return _logger.isDebugEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isErrorEnabled()
|
||||
{
|
||||
return _stdErrLog==null?true:_stdErrLog.getLevel()<=org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFatalEnabled()
|
||||
{
|
||||
return _stdErrLog==null?true:_stdErrLog.getLevel()<=org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInfoEnabled()
|
||||
{
|
||||
return _stdErrLog==null?true:_stdErrLog.getLevel()<=org.eclipse.jetty.util.log.StdErrLog.LEVEL_INFO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTraceEnabled()
|
||||
{
|
||||
return _stdErrLog==null?true:_stdErrLog.getLevel()<=org.eclipse.jetty.util.log.StdErrLog.LEVEL_DEBUG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWarnEnabled()
|
||||
{
|
||||
return _stdErrLog==null?true:_stdErrLog.getLevel()<=org.eclipse.jetty.util.log.StdErrLog.LEVEL_WARN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.debug((String)message);
|
||||
else
|
||||
_logger.debug("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.debug((String)message,t);
|
||||
else
|
||||
_logger.debug("{}",message,t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.debug((String)message);
|
||||
else
|
||||
_logger.debug("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.debug((String)message,t);
|
||||
else
|
||||
_logger.debug("{}",message,t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.info((String)message);
|
||||
else
|
||||
_logger.info("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.info((String)message,t);
|
||||
else
|
||||
_logger.info("{}",message,t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warn(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message);
|
||||
else
|
||||
_logger.warn("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warn(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message,t);
|
||||
else
|
||||
_logger.warn("{}",message,t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message);
|
||||
else
|
||||
_logger.warn("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message,t);
|
||||
else
|
||||
_logger.warn("{}",message,t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatal(Object message)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message);
|
||||
else
|
||||
_logger.warn("{}",message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatal(Object message, Throwable t)
|
||||
{
|
||||
if (message instanceof String)
|
||||
_logger.warn((String)message,t);
|
||||
else
|
||||
_logger.warn("{}",message,t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.jsp;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.jasper.servlet.JspServlet;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/**
|
||||
* JettyJspServlet
|
||||
*
|
||||
* Wrapper for the jsp servlet that handles receiving requests mapped from
|
||||
* jsp-property-groups. Mappings could be wildcard urls like "/*", which would
|
||||
* include welcome files, but we need those to be handled by the DefaultServlet.
|
||||
*/
|
||||
public class JettyJspServlet extends JspServlet
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5387857473125086791L;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
|
||||
{
|
||||
HttpServletRequest request = null;
|
||||
if (req instanceof HttpServletRequest)
|
||||
request = (HttpServletRequest)req;
|
||||
else
|
||||
throw new ServletException("Request not HttpServletRequest");
|
||||
|
||||
String servletPath=null;
|
||||
String pathInfo=null;
|
||||
if (request.getAttribute("javax.servlet.include.request_uri")!=null)
|
||||
{
|
||||
servletPath=(String)request.getAttribute("javax.servlet.include.servlet_path");
|
||||
pathInfo=(String)request.getAttribute("javax.servlet.include.path_info");
|
||||
if (servletPath==null)
|
||||
{
|
||||
servletPath=request.getServletPath();
|
||||
pathInfo=request.getPathInfo();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
servletPath = request.getServletPath();
|
||||
pathInfo = request.getPathInfo();
|
||||
}
|
||||
|
||||
String pathInContext = URIUtil.addPaths(servletPath,pathInfo);
|
||||
|
||||
String jspFile = getInitParameter("jspFile");
|
||||
|
||||
//if this is a forced-path from a jsp-file, we want the jsp servlet to handle it,
|
||||
//otherwise the default servlet might handle it
|
||||
if (jspFile == null)
|
||||
{
|
||||
if (pathInContext.endsWith("/"))
|
||||
{
|
||||
//dispatch via forward to the default servlet
|
||||
getServletContext().getNamedDispatcher("default").forward(req, resp);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//check if it resolves to a directory
|
||||
Resource resource = ((ContextHandler.Context)getServletContext()).getContextHandler().getResource(pathInContext);
|
||||
|
||||
if (resource!=null && resource.isDirectory())
|
||||
{
|
||||
//dispatch via forward to the default servlet
|
||||
getServletContext().getNamedDispatcher("default").forward(req, resp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//fall through to the normal jsp servlet handling
|
||||
super.service(req, resp);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
org.eclipse.jetty.apache.jsp.JettyJasperInitializer
|
|
@ -0,0 +1 @@
|
|||
org.eclipse.jetty.apache.jsp.JuliLog
|
|
@ -0,0 +1,71 @@
|
|||
<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">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<name>Apache :: JSTL module</name>
|
||||
<url>http://tomcat.apache.org/taglibs/standard/</url>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.apache.jstl</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<!-- JSTL Api -->
|
||||
<dependency>
|
||||
<groupId>org.apache.taglibs</groupId>
|
||||
<artifactId>taglibs-standard-spec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JSTL Impl -->
|
||||
<dependency>
|
||||
<groupId>org.apache.taglibs</groupId>
|
||||
<artifactId>taglibs-standard-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
[description]
|
||||
Enables the apache version of JSTL
|
||||
|
||||
[name]
|
||||
apache-jstl
|
||||
|
||||
[lib]
|
||||
lib/apache-jstl/*.jar
|
|
@ -1,4 +1,4 @@
|
|||
This jar file is purely to work around a problem with the Maven Dependency plugin.
|
||||
This empty jar file is purely to work around a problem with the Maven Dependency plugin.
|
||||
Several modules in jetty use the Dependency plugin to copy or unpack the dependencies of other modules.
|
||||
However, the Dependency plugin is not capable of unpacking or copying a dependency of type 'pom', which
|
||||
this module is, as it consists purely of external dependencies needed to run jsp.
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.jstl;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* Attempt at collecting up all of the JSP specific configuration bits and pieces into a single place
|
||||
* for WebAppContext users to utilize.
|
||||
*/
|
||||
public class JspConfig
|
||||
{
|
||||
public static void init(WebAppContext context, URI baseUri, File scratchDir)
|
||||
{
|
||||
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
|
||||
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
|
||||
".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
|
||||
context.setWar(baseUri.toASCIIString());
|
||||
context.setResourceBase(baseUri.toASCIIString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.jstl;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.toolchain.test.FS;
|
||||
import org.eclipse.jetty.toolchain.test.JAR;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.SimpleRequest;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class JstlTest
|
||||
{
|
||||
private static Server server;
|
||||
private static URI baseUri;
|
||||
|
||||
@BeforeClass
|
||||
public static void startServer() throws Exception
|
||||
{
|
||||
// Setup Server
|
||||
server = new Server();
|
||||
ServerConnector connector = new ServerConnector(server);
|
||||
connector.setPort(0);
|
||||
server.addConnector(connector);
|
||||
|
||||
// Setup WebAppContext
|
||||
File testWebAppDir = MavenTestingUtils.getProjectDir("src/test/webapp");
|
||||
|
||||
// Prepare WebApp libs
|
||||
File libDir = new File(testWebAppDir, "WEB-INF/lib");
|
||||
FS.ensureDirExists(libDir);
|
||||
File testTagLibDir = MavenTestingUtils.getProjectDir("src/test/taglibjar");
|
||||
JAR.create(testTagLibDir,new File(libDir, "testtaglib.jar"));
|
||||
|
||||
// Configure WebAppContext
|
||||
|
||||
Configuration.ClassList classlist = Configuration.ClassList
|
||||
.setServerDefault(server);
|
||||
|
||||
classlist.addBefore(
|
||||
"org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
|
||||
"org.eclipse.jetty.annotations.AnnotationConfiguration");
|
||||
|
||||
WebAppContext context = new WebAppContext();
|
||||
context.setContextPath("/");
|
||||
|
||||
File scratchDir = MavenTestingUtils.getTargetFile("tests/" + JstlTest.class.getSimpleName() + "-scratch");
|
||||
FS.ensureEmpty(scratchDir);
|
||||
JspConfig.init(context,testWebAppDir.toURI(),scratchDir);
|
||||
|
||||
server.setHandler(context);
|
||||
|
||||
// Start Server
|
||||
server.start();
|
||||
|
||||
// Figure out Base URI
|
||||
String host = connector.getHost();
|
||||
if (host == null)
|
||||
{
|
||||
host = "localhost";
|
||||
}
|
||||
int port = connector.getLocalPort();
|
||||
baseUri = new URI(String.format("http://%s:%d/",host,port));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void stopServer() throws Exception
|
||||
{
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlsBasic() throws IOException
|
||||
{
|
||||
SimpleRequest req = new SimpleRequest(baseUri);
|
||||
String resp = req.getString("/urls.jsp");
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<c:url")));
|
||||
assertThat("Response", resp, containsString("[c:url value] = /ref.jsp;jsessionid="));
|
||||
assertThat("Response", resp, containsString("[c:url param] = ref.jsp;key=value;jsessionid="));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCatchBasic() throws IOException
|
||||
{
|
||||
SimpleRequest req = new SimpleRequest(baseUri);
|
||||
String resp = req.getString("/catch-basic.jsp");
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<c:catch")));
|
||||
assertThat("Response", resp, containsString("[c:catch] exception : " + JspException.class.getName()));
|
||||
assertThat("Response", resp, containsString("[c:catch] exception.message : In <parseNumber>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testCatchTaglib() throws IOException
|
||||
{
|
||||
SimpleRequest req = new SimpleRequest(baseUri);
|
||||
String resp = req.getString("/catch-taglib.jsp");
|
||||
System.out.println("resp = " + resp);
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<c:catch>")));
|
||||
assertThat("Response should be JSP processed", resp, not(containsString("<jtest:errorhandler>")));
|
||||
assertThat("Response", resp, not(containsString("[jtest:errorhandler] exception is null")));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
|
||||
version="2.0">
|
||||
|
||||
<description>eclipse jetty test taglib</description>
|
||||
<tlib-version>1.0</tlib-version>
|
||||
|
||||
<short-name>jtest</short-name>
|
||||
<uri>org.eclipse.jetty.jstl.jtest</uri>
|
||||
|
||||
<tag-file>
|
||||
<name>errorhandler</name>
|
||||
<path>/META-INF/tags/errorhandler.tag</path>
|
||||
</tag-file>
|
||||
</taglib>
|
|
@ -0,0 +1,12 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
|
||||
<c:catch var="tossable">
|
||||
<jsp:doBody />
|
||||
</c:catch>
|
||||
<c:if test="${tossable != null}">
|
||||
[jtest:errorhandler] exception : ${tossable}
|
||||
[jtest:errorhandler] exception.message : ${tossable.message}
|
||||
</c:if>
|
||||
<c:if test="${tossable == null}">
|
||||
[jtest:errorhandler] exception is null
|
||||
</c:if>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
<description>Test webapp for JSTL</description>
|
||||
</web-app>
|
|
@ -0,0 +1,16 @@
|
|||
<%@ page contentType="text/plain; charset=UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
Title: JSTL c:catch test
|
||||
|
||||
<c:catch var ="catchException">
|
||||
<fmt:parseNumber var="parsedNum" value="aaa" />
|
||||
</c:catch>
|
||||
|
||||
<c:if test = "${catchException != null}">
|
||||
[c:catch] exception : ${catchException}
|
||||
[c:catch] exception.message : ${catchException.message}
|
||||
</c:if>
|
||||
<c:if test = "${catchException == null}">
|
||||
[c:catch] exception is null
|
||||
</c:if>
|
|
@ -0,0 +1,11 @@
|
|||
<%@ page contentType="text/plain; charset=UTF-8" %>
|
||||
<%@ taglib uri="org.eclipse.jetty.jstl.jtest" prefix="jtest" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||
Title: JSTL c:catch test
|
||||
|
||||
<jtest:errorhandler>
|
||||
<fmt:parseNumber var="parsedNum" value="aaa" />
|
||||
</jtest:errorhandler>
|
||||
|
||||
parsedNum = <c:out value="${parsedNum}"/>
|
|
@ -0,0 +1,2 @@
|
|||
<%@ page contentType="text/plain; charset=UTF-8" %>
|
||||
Reference Page: No useful content here, just used for other tests
|
|
@ -0,0 +1,6 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@ page contentType="text/plain; charset=UTF-8" %>
|
||||
Title: JSTL c:url Tests
|
||||
[c:url value] = <c:url value="/ref.jsp" />
|
||||
<c:set var="foo" value="ref.jsp;key=value"/>
|
||||
[c:url param] = <c:url value="${foo}"><c:param name="noframe" value="true"/></c:url>
|
|
@ -1,103 +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>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.dist</groupId>
|
||||
<artifactId>dist-parent</artifactId>
|
||||
<version>9.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>jetty-deb</artifactId>
|
||||
<name>Jetty :: Unix Distributions :: Debian</name>
|
||||
<packaging>deb</packaging>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty.toolchain</groupId>
|
||||
<artifactId>unix-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-6.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<contact>Jetty Project</contact>
|
||||
<contactEmail>jetty-dev@eclipse.org</contactEmail>
|
||||
<name>Core Jetty ${project.version} Distribution</name>
|
||||
<description>Jetty provides an Web server and javax.servlet
|
||||
container, plus support for Web Sockets, OSGi, JMX, JNDI,
|
||||
JASPI, AJP and many other integrations. These components are
|
||||
open source and available for commercial use and
|
||||
distribution.</description>
|
||||
<deb>
|
||||
<useFakeroot>false</useFakeroot>
|
||||
<priority>optional</priority>
|
||||
<section>java</section>
|
||||
</deb>
|
||||
<packages>
|
||||
<package>
|
||||
<id>jetty-server</id>
|
||||
<assembly>
|
||||
<extractArtifact>
|
||||
<artifact>org.eclipse.jetty:jetty-distribution:zip</artifact>
|
||||
<to>/usr/share/jetty9</to>
|
||||
<pattern>/jetty-distribution-${project.version}(.*)</pattern>
|
||||
<replacement>$1</replacement>
|
||||
<excludes>
|
||||
<exclude>jetty-distribution-*/javadoc</exclude>
|
||||
<exclude>jetty-distribution-*/javadoc/**</exclude>
|
||||
<exclude>jetty-distribution-*/logs/**</exclude>
|
||||
<exclude>jetty-distribution-*/bin/**</exclude>
|
||||
<exclude>jetty-distribution-*/etc/**</exclude>
|
||||
<exclude>jetty-distribution-*/webapps/**</exclude>
|
||||
<exclude>jetty-distribution-*/*.html</exclude>
|
||||
<exclude>jetty-distribution-*/*.txt</exclude>
|
||||
</excludes>
|
||||
</extractArtifact>
|
||||
<extractArtifact>
|
||||
<artifact>org.eclipse.jetty:jetty-distribution:zip</artifact>
|
||||
<to>/usr/share/doc/jetty9</to>
|
||||
<pattern>/jetty-distribution-${project.version}(.*)</pattern>
|
||||
<replacement>$1</replacement>
|
||||
<excludes>
|
||||
<include>jetty-distribution-*/*.html</include>
|
||||
<include>jetty-distribution-*/*.txt</include>
|
||||
<exclude>jetty-distribution-*/**</exclude>
|
||||
</excludes>
|
||||
</extractArtifact>
|
||||
<extractArtifact>
|
||||
<artifact>org.eclipse.jetty:jetty-distribution:zip</artifact>
|
||||
<to>/etc/jetty9</to>
|
||||
<pattern>/jetty-distribution-${project.version}(.*)</pattern>
|
||||
<replacement>$1</replacement>
|
||||
<excludes>
|
||||
<include>jetty-distribution-*/etc/**</include>
|
||||
<!-- exclude>jetty-distribution-*/**</exclude-->
|
||||
</excludes>
|
||||
</extractArtifact>
|
||||
</assembly>
|
||||
</package>
|
||||
<package>
|
||||
<id>jetty-test-webapp</id>
|
||||
<classifier>test-webapp</classifier>
|
||||
<assembly>
|
||||
<extractArtifact>
|
||||
<artifact>org.eclipse.jetty:jetty-distribution:zip</artifact>
|
||||
<to>/var/lib/jetty9/webapps</to>
|
||||
<pattern>/jetty-distribution-${project.version}(.*)</pattern>
|
||||
<replacement>$1</replacement>
|
||||
<includes>
|
||||
<include>jetty-distribution-*/webapps/**</include>
|
||||
</includes>
|
||||
</extractArtifact>
|
||||
</assembly>
|
||||
</package>
|
||||
</packages>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-distribution</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOG_DIR=/var/lib/jetty9/logs
|
||||
WEBAPP_DIR=/var/lib/jetty9/webapps
|
||||
|
||||
# copy the jetty start script into place
|
||||
cp /usr/share/jetty9/bin/jetty.sh /etc/init.d/jetty
|
||||
|
||||
# make it generally executable
|
||||
chmod 755 /etc/init.d/jetty
|
||||
|
||||
# ensure we have a logging directory
|
||||
if [ ! -d "$LOG_DIR" ]; then
|
||||
mkdir $LOG_DIR
|
||||
fi
|
||||
|
||||
# ensure we have a webapps directory
|
||||
if [ ! -d "$WEBAPP_DIR" ]; then
|
||||
mkdir $WEBAPP_DIR
|
||||
fi
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#rm -f /etc/init.d/jetty
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
[...]
|
||||
# find first and last SYSTEM_UID numbers
|
||||
for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"`; do
|
||||
case $LINE in
|
||||
FIRST_SYSTEM_UID*)
|
||||
FIST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
|
||||
;;
|
||||
LAST_SYSTEM_UID*)
|
||||
LAST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# Remove system account if necessary
|
||||
CREATEDUSER="jetty"
|
||||
if [ -n "$FIST_SYSTEM_UID" ] && [ -n "$LAST_SYSTEM_UID" ]; then
|
||||
if USERID=`getent passwd $CREATEDUSER | cut -f 3 -d ':'`; then
|
||||
if [ -n "$USERID" ]; then
|
||||
if [ "$FIST_SYSTEM_UID" -le "$USERID" ] && \
|
||||
[ "$USERID" -le "$LAST_SYSTEM_UID" ]; then
|
||||
echo -n "Removing $CREATEDUSER system user.."
|
||||
deluser --quiet $CREATEDUSER || true
|
||||
echo "..done"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# Remove system group if necessary
|
||||
CREATEDGROUP="jetty"
|
||||
FIRST_USER_GID=`grep ^USERS_GID /etc/adduser.conf | cut -f2 -d '='`
|
||||
if [ -n "$FIST_USER_GID" ] then
|
||||
if GROUPGID=`getent group $CREATEDGROUP | cut -f 3 -d ':'`; then
|
||||
if [ -n "$GROUPGID" ]; then
|
||||
if [ "$FIST_USER_GID" -gt "$GROUPGID" ]; then
|
||||
echo -n "Removing $CREATEDGROUP group.."
|
||||
delgroup --only-if-empty $CREATEDGROUP || true
|
||||
echo "..done"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
|
@ -1,61 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
|
||||
# If the package has default file it could be sourced, so that
|
||||
# the local admin can overwrite the defaults
|
||||
|
||||
[ -f "/etc/default/jetty9" ] && . /etc/default/jetty9
|
||||
|
||||
# Sane defaults:
|
||||
|
||||
[ -z "$SERVER_HOME" ] && SERVER_HOME=/usr/share/jetty9
|
||||
[ -z "$SERVER_USER" ] && SERVER_USER=jetty
|
||||
[ -z "$SERVER_NAME" ] && SERVER_NAME="Jetty-9 Http and Servlet Engine"
|
||||
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=jetty
|
||||
|
||||
# Groups that the user will be added to, if undefined, then none.
|
||||
ADDGROUP=""
|
||||
|
||||
# create user to avoid running server as root
|
||||
# 1. create group if not existing
|
||||
if ! getent group | grep -q "^$SERVER_GROUP:" ; then
|
||||
echo -n "Adding group $SERVER_GROUP.."
|
||||
addgroup --quiet --system $SERVER_GROUP 2>/dev/null ||true
|
||||
echo "..done"
|
||||
fi
|
||||
# 2. create homedir if not existing
|
||||
test -d $SERVER_HOME || mkdir $SERVER_HOME
|
||||
# 3. create user if not existing
|
||||
if ! getent passwd | grep -q "^$SERVER_USER:"; then
|
||||
echo -n "Adding system user $SERVER_USER.."
|
||||
adduser --quiet \
|
||||
--system \
|
||||
--ingroup $SERVER_GROUP \
|
||||
--no-create-home \
|
||||
--disabled-password \
|
||||
$SERVER_USER 2>/dev/null || true
|
||||
echo "..done"
|
||||
fi
|
||||
# 4. adjust passwd entry
|
||||
usermod -c "$SERVER_NAME" \
|
||||
-d $SERVER_HOME \
|
||||
-g $SERVER_GROUP \
|
||||
$SERVER_USER
|
||||
# 5. adjust file and directory permissions
|
||||
if ! dpkg-statoverride --list $SERVER_HOME >/dev/null
|
||||
then
|
||||
chown -R $SERVER_USER:$SERVER_GROUP $SERVER_HOME
|
||||
chmod u=rwx,g=rxs,o= $SERVER_HOME
|
||||
fi
|
||||
# 6. Add the user to the ADDGROUP group
|
||||
if test -n $ADDGROUP
|
||||
then
|
||||
if ! groups $SERVER_USER | cut -d: -f2 | \
|
||||
grep -qw $ADDGROUP; then
|
||||
adduser $SERVER_USER $ADDGROUP
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
configure)
|
|
@ -1,26 +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/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<version>9.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.dist</groupId>
|
||||
<artifactId>dist-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Jetty :: Distribution :: Parent</name>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>linux-packaging</id>
|
||||
<!-- activation>
|
||||
<os>
|
||||
<name>Linux</name>
|
||||
</os>
|
||||
</activation-->
|
||||
<modules>
|
||||
<module>jetty-deb</module>
|
||||
<!--module>jetty-rpm</module-->
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>example-async-rest</artifactId>
|
||||
<version>9.1.3-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.example-async-rest</groupId>
|
||||
|
@ -10,6 +10,9 @@
|
|||
<packaging>jar</packaging>
|
||||
<name>Example Async Rest :: Jar</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.examples.asyc.rest</bundle-symbolic-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-fragment
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>example-async-rest</artifactId>
|
||||
<version>9.1.3-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.example-async-rest</groupId>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<!--
|
||||
This is the jetty specific web application configuration file. When starting
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -28,7 +28,7 @@ public class DemoServer
|
|||
{
|
||||
String jetty_home = System.getProperty("jetty.home",".");
|
||||
|
||||
Server server = new Server(Integer.getInteger("jetty.port",8080).intValue());
|
||||
Server server = new Server(Integer.getInteger("jetty.http.port",8080).intValue());
|
||||
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.examples</groupId>
|
||||
<artifactId>examples-parent</artifactId>
|
||||
<version>9.1.3-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.examples</groupId>
|
||||
<artifactId>examples-parent</artifactId>
|
||||
<version>9.1.3-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -11,6 +11,9 @@
|
|||
<name>Example :: Jetty Embedded</name>
|
||||
<description>Jetty Embedded Examples</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.embedded</bundle-symbolic-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -53,13 +56,18 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.alpn</groupId>
|
||||
<artifactId>alpn-api</artifactId>
|
||||
<version>${alpn.api.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -80,11 +88,42 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-proxy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaas</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<!-- scope>test</scope-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.servlet.AsyncContext;
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.WriteListener;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
public class AsyncEchoServlet extends HttpServlet
|
||||
{
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
AsyncContext asyncContext = request.startAsync(request, response);
|
||||
asyncContext.setTimeout(0);
|
||||
Echoer echoer = new Echoer(asyncContext);
|
||||
request.getInputStream().setReadListener(echoer);
|
||||
response.getOutputStream().setWriteListener(echoer);
|
||||
}
|
||||
|
||||
private class Echoer implements ReadListener, WriteListener
|
||||
{
|
||||
private final byte[] buffer = new byte[4096];
|
||||
private final AsyncContext asyncContext;
|
||||
private final ServletInputStream input;
|
||||
private final ServletOutputStream output;
|
||||
private final AtomicBoolean complete = new AtomicBoolean(false);
|
||||
|
||||
private Echoer(AsyncContext asyncContext) throws IOException
|
||||
{
|
||||
this.asyncContext = asyncContext;
|
||||
this.input = asyncContext.getRequest().getInputStream();
|
||||
this.output = asyncContext.getResponse().getOutputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataAvailable() throws IOException
|
||||
{
|
||||
onWritePossible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAllDataRead() throws IOException
|
||||
{
|
||||
onWritePossible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWritePossible() throws IOException
|
||||
{
|
||||
// This method is called:
|
||||
// 1) after first registering a WriteListener (ready for first write)
|
||||
// 2) after first registering a ReadListener iff write is ready
|
||||
// 3) when a previous write completes after an output.isReady() returns false
|
||||
// 4) from an input callback
|
||||
|
||||
// We should try to read, only if we are able to write!
|
||||
while (output.isReady() && input.isReady())
|
||||
{
|
||||
int read = input.read(buffer);
|
||||
if (read<0)
|
||||
{
|
||||
if (complete.compareAndSet(false,true))
|
||||
asyncContext.complete();
|
||||
break;
|
||||
}
|
||||
else if (read>0)
|
||||
{
|
||||
output.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable failure)
|
||||
{
|
||||
failure.printStackTrace();
|
||||
asyncContext.complete();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -19,6 +19,7 @@
|
|||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
@ -28,26 +29,31 @@ import javax.servlet.http.HttpServletResponse;
|
|||
@SuppressWarnings("serial")
|
||||
public class DumpServlet extends HttpServlet
|
||||
{
|
||||
public DumpServlet()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
protected void doGet( HttpServletRequest request,
|
||||
HttpServletResponse response ) throws ServletException,
|
||||
IOException
|
||||
{
|
||||
response.setContentType("text/html");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.getWriter().println("<h1>DumpServlet</h1><pre>");
|
||||
response.getWriter().println("requestURI=" + request.getRequestURI());
|
||||
response.getWriter().println("contextPath=" + request.getContextPath());
|
||||
response.getWriter().println("servletPath=" + request.getServletPath());
|
||||
response.getWriter().println("pathInfo=" + request.getPathInfo());
|
||||
response.getWriter().println("session=" + request.getSession(true).getId());
|
||||
|
||||
String r=request.getParameter("resource");
|
||||
if (r!=null)
|
||||
response.getWriter().println("resource("+r+")=" + getServletContext().getResource(r));
|
||||
|
||||
response.getWriter().println("</pre>");
|
||||
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
out.println("<h1>DumpServlet</h1>");
|
||||
out.println("<pre>");
|
||||
out.println("requestURI=" + request.getRequestURI());
|
||||
out.println("contextPath=" + request.getContextPath());
|
||||
out.println("servletPath=" + request.getServletPath());
|
||||
out.println("pathInfo=" + request.getPathInfo());
|
||||
out.println("session=" + request.getSession(true).getId());
|
||||
|
||||
String r = request.getParameter("resource");
|
||||
if (r != null)
|
||||
{
|
||||
out.println("resource(" + r + ")="
|
||||
+ getServletContext().getResource(r));
|
||||
}
|
||||
|
||||
out.println("</pre>");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -25,24 +25,24 @@ import org.eclipse.jetty.server.ServerConnector;
|
|||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
|
||||
public class ExampleServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server();
|
||||
|
||||
ServerConnector connector=new ServerConnector(server);
|
||||
ServerConnector connector = new ServerConnector(server);
|
||||
connector.setPort(8080);
|
||||
server.setConnectors(new Connector[]{connector});
|
||||
|
||||
server.setConnectors(new Connector[] { connector });
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler();
|
||||
context.setContextPath("/hello");
|
||||
context.addServlet(HelloServlet.class,"/");
|
||||
|
||||
context.setContextPath("/");
|
||||
context.addServlet(HelloServlet.class, "/hello");
|
||||
context.addServlet(AsyncEchoServlet.class, "/echo/*");
|
||||
|
||||
HandlerCollection handlers = new HandlerCollection();
|
||||
handlers.setHandlers(new Handler[]{context,new DefaultHandler()});
|
||||
handlers.setHandlers(new Handler[] { context, new DefaultHandler() });
|
||||
server.setHandler(handlers);
|
||||
|
||||
server.start();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -21,11 +21,20 @@ package org.eclipse.jetty.embedded;
|
|||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
|
||||
/**
|
||||
* Configures and Starts a Jetty server from an XML declaration.
|
||||
* <p>
|
||||
* See <a href=
|
||||
* "http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/examples/embedded/src/main/resources/exampleserver.xml"
|
||||
* >exampleserver.xml</a>
|
||||
* </p>
|
||||
*/
|
||||
public class ExampleServerXml
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Resource fileserver_xml = Resource.newSystemResource("exampleserver.xml");
|
||||
XmlConfiguration.main(fileserver_xml.getFile().getAbsolutePath());
|
||||
// Find Jetty XML (in classpath) that configures and starts Server.
|
||||
Resource serverXml = Resource.newSystemResource("exampleserver.xml");
|
||||
XmlConfiguration.main(serverXml.getFile().getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -45,25 +45,28 @@ import org.eclipse.jetty.util.Callback;
|
|||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Fast FileServer.
|
||||
*
|
||||
* <p>This example shows how to use the Jetty APIs for sending static
|
||||
* as fast as possible using various strategies for small, medium and
|
||||
* large content.</p>
|
||||
* <p>The Jetty {@link DefaultServlet} does all this and more, and to
|
||||
* a lesser extent so does the {@link ResourceHandler}, so unless you
|
||||
* have exceptional circumstances it is best to use those classes for
|
||||
* static content</p>
|
||||
/**
|
||||
* Fast FileServer.
|
||||
* <p>
|
||||
* This example shows how to use the Jetty APIs for sending static as fast as
|
||||
* possible using various strategies for small, medium and large content.
|
||||
* </p>
|
||||
* <p>
|
||||
* The Jetty {@link DefaultServlet} does all this and more, and to a lesser
|
||||
* extent so does the {@link ResourceHandler}, so unless you have exceptional
|
||||
* circumstances it is best to use those classes for static content
|
||||
* </p>
|
||||
*/
|
||||
public class FastFileServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
|
||||
HandlerList handlers = new HandlerList();
|
||||
handlers.setHandlers(new Handler[] { new FastFileHandler(new File(".")), new DefaultHandler() });
|
||||
handlers.setHandlers(new Handler[] {
|
||||
new FastFileHandler(new File(System.getProperty("user.dir"))),
|
||||
new DefaultHandler() });
|
||||
server.setHandler(handlers);
|
||||
|
||||
server.start();
|
||||
|
@ -72,65 +75,74 @@ public class FastFileServer
|
|||
|
||||
static class FastFileHandler extends AbstractHandler
|
||||
{
|
||||
private final MimeTypes _mimeTypes = new MimeTypes();
|
||||
private final File _dir;
|
||||
|
||||
FastFileHandler(File dir)
|
||||
private final MimeTypes mimeTypes = new MimeTypes();
|
||||
private final File dir;
|
||||
|
||||
private FastFileHandler( File dir )
|
||||
{
|
||||
_dir=dir;
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
public void handle( String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response ) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
// define small medium and large.
|
||||
// This should be turned for your content, JVM and OS, but we will huge HTTP response buffer size as a measure
|
||||
final int SMALL=response.getBufferSize();
|
||||
final int MEDIUM=8*SMALL;
|
||||
|
||||
|
||||
// define small medium and large.
|
||||
// This should be turned for your content, JVM and OS, but we will
|
||||
// huge HTTP response buffer size as a measure
|
||||
final int SMALL = response.getBufferSize();
|
||||
final int MEDIUM = 8 * SMALL;
|
||||
|
||||
// What file to serve?
|
||||
final File file = new File(_dir,request.getPathInfo());
|
||||
|
||||
final File file = new File(this.dir, request.getPathInfo());
|
||||
|
||||
// Only handle existing files
|
||||
if (!file.exists())
|
||||
return;
|
||||
|
||||
// we will handle this request
|
||||
baseRequest.setHandled(true);
|
||||
|
||||
|
||||
// Handle directories
|
||||
if (file.isDirectory())
|
||||
{
|
||||
if (!request.getPathInfo().endsWith(URIUtil.SLASH))
|
||||
{
|
||||
response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH)));
|
||||
response.sendRedirect(response.encodeRedirectURL(URIUtil
|
||||
.addPaths(request.getRequestURI(), URIUtil.SLASH)));
|
||||
return;
|
||||
}
|
||||
String listing = Resource.newResource(file).getListHTML(request.getRequestURI(),request.getPathInfo().lastIndexOf("/") > 0);
|
||||
response.setContentType("text/html; charset=UTF-8");
|
||||
String listing = Resource.newResource(file).getListHTML(
|
||||
request.getRequestURI(),
|
||||
request.getPathInfo().lastIndexOf("/") > 0);
|
||||
response.setContentType("text/html; charset=utf-8");
|
||||
response.getWriter().println(listing);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set some content headers.
|
||||
|
||||
// Set some content headers
|
||||
// Jetty DefaultServlet will cache formatted date strings, but we will reformat for each request here
|
||||
response.setDateHeader("Last-Modified",file.lastModified());
|
||||
response.setDateHeader("Content-Length",file.length());
|
||||
response.setContentType(_mimeTypes.getMimeByExtension(file.getName()));
|
||||
|
||||
|
||||
|
||||
// Jetty DefaultServlet will cache formatted date strings, but we
|
||||
// will reformat for each request here
|
||||
response.setDateHeader("Last-Modified", file.lastModified());
|
||||
response.setDateHeader("Content-Length", file.length());
|
||||
response.setContentType(mimeTypes.getMimeByExtension(file.getName()));
|
||||
|
||||
// send "small" files blocking directly from an input stream
|
||||
if (file.length()<SMALL)
|
||||
if (file.length() < SMALL)
|
||||
{
|
||||
// need to caste to Jetty output stream for best API
|
||||
((HttpOutput)response.getOutputStream()).sendContent(FileChannel.open(file.toPath(),StandardOpenOption.READ));
|
||||
((HttpOutput) response.getOutputStream())
|
||||
.sendContent(FileChannel.open(file.toPath(),
|
||||
StandardOpenOption.READ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// send not "small" files asynchronously so we don't hold threads if the client is slow
|
||||
|
||||
// send not "small" files asynchronously so we don't hold threads if
|
||||
// the client is slow
|
||||
final AsyncContext async = request.startAsync();
|
||||
Callback completionCB = new Callback()
|
||||
{
|
||||
|
@ -142,41 +154,43 @@ public class FastFileServer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void failed(Throwable x)
|
||||
public void failed( Throwable x )
|
||||
{
|
||||
// log error and complete async response;
|
||||
x.printStackTrace();
|
||||
async.complete();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// send "medium" files from an input stream
|
||||
if (file.length()<MEDIUM)
|
||||
if (file.length() < MEDIUM)
|
||||
{
|
||||
// the file channel is closed by the async send
|
||||
((HttpOutput)response.getOutputStream()).sendContent(FileChannel.open(file.toPath(),StandardOpenOption.READ),completionCB);
|
||||
((HttpOutput) response.getOutputStream())
|
||||
.sendContent(FileChannel.open(file.toPath(),
|
||||
StandardOpenOption.READ), completionCB);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// for "large" files get the file mapped buffer to send
|
||||
// Typically the resulting buffer should be cached as allocating kernel memory
|
||||
// can be hard to GC on some JVMs. But for this example we will create a new buffer per file
|
||||
ByteBuffer buffer;
|
||||
try (RandomAccessFile raf = new RandomAccessFile(file,"r");)
|
||||
{
|
||||
buffer=raf.getChannel().map(MapMode.READ_ONLY,0,raf.length());
|
||||
}
|
||||
|
||||
// Assuming the file buffer might be shared cached version, so lets take our own view of it
|
||||
buffer=buffer.asReadOnlyBuffer();
|
||||
|
||||
|
||||
// send the content as a buffer with a callback to complete the async request
|
||||
// need to caste to Jetty output stream for best API
|
||||
((HttpOutput)response.getOutputStream()).sendContent(buffer,completionCB);
|
||||
}
|
||||
// for "large" files get the file mapped buffer to send Typically
|
||||
// the resulting buffer should be cached as allocating kernel memory
|
||||
// can be hard to GC on some JVMs. But for this example we will
|
||||
// create a new buffer per file
|
||||
ByteBuffer buffer;
|
||||
try ( RandomAccessFile raf = new RandomAccessFile(file, "r"); )
|
||||
{
|
||||
buffer = raf.getChannel().map(MapMode.READ_ONLY, 0,
|
||||
raf.length());
|
||||
}
|
||||
|
||||
// Assuming the file buffer might be shared cached version, so lets
|
||||
// take our own view of it
|
||||
buffer = buffer.asReadOnlyBuffer();
|
||||
|
||||
// send the content as a buffer with a callback to complete the
|
||||
// async request need to caste to Jetty output stream for best API
|
||||
((HttpOutput) response.getOutputStream()).sendContent(buffer,
|
||||
completionCB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -23,9 +23,10 @@ import org.eclipse.jetty.server.Server;
|
|||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.server.handler.ResourceHandler;
|
||||
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** Simple Jetty FileServer.
|
||||
/**
|
||||
* Simple Jetty FileServer.
|
||||
* This is a simple example of Jetty configured as a FileServer.
|
||||
*/
|
||||
public class FileServer
|
||||
|
@ -47,14 +48,15 @@ public class FileServer
|
|||
resource_handler.setResourceBase(".");
|
||||
|
||||
// Add the ResourceHandler to the server.
|
||||
GzipHandler gzip = new GzipHandler();
|
||||
server.setHandler(gzip);
|
||||
HandlerList handlers = new HandlerList();
|
||||
handlers.setHandlers(new Handler[] { resource_handler, new DefaultHandler() });
|
||||
server.setHandler(handlers);
|
||||
gzip.setHandler(handlers);
|
||||
|
||||
// Start things up! By using the server.join() the server thread will join with the current thread.
|
||||
// See "http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()" for more details.
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -22,22 +22,26 @@ import org.eclipse.jetty.server.Server;
|
|||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** A Jetty FileServer.
|
||||
* This server is identical to {@link FileServer}, except that it
|
||||
* is configured via an {@link XmlConfiguration} config file that
|
||||
* does the identical work.
|
||||
/**
|
||||
* A Jetty FileServer.
|
||||
* <p>
|
||||
* See <a href="http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/example-jetty-embedded/src/main/resources/fileserver.xml">fileserver.xml</a>
|
||||
* This server is identical to {@link FileServer}, except that it is configured
|
||||
* via an {@link XmlConfiguration} config file that does the identical work.
|
||||
* </p>
|
||||
* <p>
|
||||
* See <a href=
|
||||
* "http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/examples/embedded/src/main/resources/fileserver.xml"
|
||||
* >fileserver.xml</a>
|
||||
* </p>
|
||||
*/
|
||||
public class FileServerXml
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Resource fileserver_xml = Resource.newSystemResource("fileserver.xml");
|
||||
XmlConfiguration configuration = new XmlConfiguration(fileserver_xml.getInputStream());
|
||||
Server server = (Server)configuration.configure();
|
||||
Resource fileserverXml = Resource.newSystemResource("fileserver.xml");
|
||||
XmlConfiguration configuration = new XmlConfiguration(
|
||||
fileserverXml.getInputStream());
|
||||
Server server = (Server) configuration.configure();
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -19,6 +19,7 @@
|
|||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -29,35 +30,42 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
|
||||
public class HelloHandler extends AbstractHandler
|
||||
{
|
||||
final String _greeting;
|
||||
final String _body;
|
||||
final String greeting;
|
||||
final String body;
|
||||
|
||||
public HelloHandler()
|
||||
{
|
||||
_greeting="Hello World";
|
||||
_body=null;
|
||||
this("Hello World");
|
||||
}
|
||||
|
||||
public HelloHandler(String greeting)
|
||||
public HelloHandler( String greeting )
|
||||
{
|
||||
_greeting=greeting;
|
||||
_body=null;
|
||||
this(greeting, null);
|
||||
}
|
||||
|
||||
public HelloHandler(String greeting,String body)
|
||||
public HelloHandler( String greeting, String body )
|
||||
{
|
||||
_greeting=greeting;
|
||||
_body=body;
|
||||
this.greeting = greeting;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
public void handle( String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response ) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
response.setContentType("text/html; charset=utf-8");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
baseRequest.setHandled(true);
|
||||
|
||||
response.getWriter().println("<h1>"+_greeting+"</h1>");
|
||||
if (_body!=null)
|
||||
response.getWriter().println(_body);
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
out.println("<h1>" + greeting + "</h1>");
|
||||
if (body != null)
|
||||
{
|
||||
out.println(body);
|
||||
}
|
||||
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -28,22 +28,26 @@ import javax.servlet.http.HttpServletResponse;
|
|||
@SuppressWarnings("serial")
|
||||
public class HelloServlet extends HttpServlet
|
||||
{
|
||||
String greeting = "Hello";
|
||||
final String greeting;
|
||||
|
||||
public HelloServlet()
|
||||
{
|
||||
this("Hello");
|
||||
}
|
||||
|
||||
public HelloServlet(String hi)
|
||||
public HelloServlet( String greeting )
|
||||
{
|
||||
greeting = hi;
|
||||
this.greeting = greeting;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
protected void doGet( HttpServletRequest request,
|
||||
HttpServletResponse response ) throws ServletException,
|
||||
IOException
|
||||
{
|
||||
response.setContentType("text/html");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.getWriter().println("<h1>" + greeting + " from HelloServlet</h1>");
|
||||
response.getWriter().println(
|
||||
"<h1>" + greeting + " from HelloServlet</h1>");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -16,6 +16,8 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
@ -29,23 +31,30 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
public class HelloWorld extends AbstractHandler
|
||||
{
|
||||
@Override
|
||||
public void handle(String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response)
|
||||
throws IOException, ServletException
|
||||
public void handle( String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response ) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
// Declare response encoding and types
|
||||
response.setContentType("text/html; charset=utf-8");
|
||||
|
||||
// Declare response status code
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
baseRequest.setHandled(true);
|
||||
|
||||
// Write back response
|
||||
response.getWriter().println("<h1>Hello World</h1>");
|
||||
|
||||
// Inform jetty that this request has now been handled
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
server.setHandler(new HelloWorld());
|
||||
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import javax.servlet.DispatcherType;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.Servlet;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.eclipse.jetty.alpn.ALPN;
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.http2.HTTP2Cipher;
|
||||
import org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;
|
||||
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.NegotiatingServerConnectionFactory;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
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.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.servlets.PushCacheFilter;
|
||||
import org.eclipse.jetty.servlets.PushSessionCacheFilter;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
*/
|
||||
public class Http2Server
|
||||
{
|
||||
public static void main(String... args) throws Exception
|
||||
{
|
||||
Server server = new Server();
|
||||
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(server, "/",ServletContextHandler.SESSIONS);
|
||||
context.setResourceBase("src/main/resources/docroot");
|
||||
context.addFilter(PushCacheFilter.class,"/*",EnumSet.of(DispatcherType.REQUEST));
|
||||
// context.addFilter(PushSessionCacheFilter.class,"/*",EnumSet.of(DispatcherType.REQUEST));
|
||||
context.addFilter(PushedTilesFilter.class,"/*",EnumSet.of(DispatcherType.REQUEST));
|
||||
context.addServlet(new ServletHolder(servlet), "/test/*");
|
||||
context.addServlet(DefaultServlet.class, "/").setInitParameter("maxCacheSize","81920");
|
||||
server.setHandler(context);
|
||||
|
||||
// HTTP Configuration
|
||||
HttpConfiguration http_config = new HttpConfiguration();
|
||||
http_config.setSecureScheme("https");
|
||||
http_config.setSecurePort(8443);
|
||||
http_config.setSendXPoweredBy(true);
|
||||
http_config.setSendServerVersion(true);
|
||||
|
||||
// HTTP Connector
|
||||
ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config), new HTTP2CServerConnectionFactory(http_config));
|
||||
http.setPort(8080);
|
||||
server.addConnector(http);
|
||||
|
||||
// SSL Context Factory for HTTPS and HTTP/2
|
||||
String jetty_distro = System.getProperty("jetty.distro","../../jetty-distribution/target/distribution");
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStorePath(jetty_distro + "/demo-base/etc/keystore");
|
||||
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
|
||||
|
||||
// HTTPS Configuration
|
||||
HttpConfiguration https_config = new HttpConfiguration(http_config);
|
||||
https_config.addCustomizer(new SecureRequestCustomizer());
|
||||
|
||||
// HTTP/2 Connection Factory
|
||||
HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(https_config);
|
||||
|
||||
NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
|
||||
ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory();
|
||||
alpn.setDefaultProtocol(http.getDefaultProtocol());
|
||||
|
||||
// SSL Connection Factory
|
||||
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,alpn.getProtocol());
|
||||
|
||||
// HTTP/2 Connector
|
||||
ServerConnector http2Connector =
|
||||
new ServerConnector(server,ssl,alpn,h2,new HttpConnectionFactory(https_config));
|
||||
http2Connector.setPort(8443);
|
||||
server.addConnector(http2Connector);
|
||||
|
||||
ALPN.debug=false;
|
||||
|
||||
server.start();
|
||||
//server.dumpStdErr();
|
||||
server.join();
|
||||
}
|
||||
|
||||
public static class PushedTilesFilter implements Filter
|
||||
{
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
|
||||
{
|
||||
Request baseRequest = Request.getBaseRequest(request);
|
||||
|
||||
if (baseRequest.isPush() && baseRequest.getRequestURI().contains("tiles") )
|
||||
{
|
||||
String uri = baseRequest.getRequestURI().replace("tiles","pushed").substring(baseRequest.getContextPath().length());
|
||||
request.getRequestDispatcher(uri).forward(request,response);
|
||||
return;
|
||||
}
|
||||
|
||||
chain.doFilter(request,response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static Servlet servlet = new HttpServlet()
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
{
|
||||
String code=request.getParameter("code");
|
||||
if (code!=null)
|
||||
response.setStatus(Integer.parseInt(code));
|
||||
|
||||
HttpSession session = request.getSession(true);
|
||||
if (session.isNew())
|
||||
response.addCookie(new Cookie("bigcookie",
|
||||
"This is a test cookies that was created on "+new Date()+" and is used by the jetty http/2 test servlet."));
|
||||
response.setHeader("Custom","Value");
|
||||
response.setContentType("text/plain");
|
||||
String content = "Hello from Jetty using "+request.getProtocol() +"\n";
|
||||
content+="uri="+request.getRequestURI()+"\n";
|
||||
content+="session="+session.getId()+(session.isNew()?"(New)\n":"\n");
|
||||
content+="date="+new Date()+"\n";
|
||||
|
||||
for (Cookie c : request.getCookies())
|
||||
content+="cookie "+c.getName()+"="+c.getValue()+"\n";
|
||||
|
||||
response.setContentLength(content.length());
|
||||
response.getOutputStream().print(content);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class JarServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler();
|
||||
Resource.setDefaultUseCaches(true);
|
||||
Resource base = Resource.newResource("jar:file:src/main/resources/content.jar!/");
|
||||
context.setBaseResource(base);
|
||||
context.addServlet(new ServletHolder(new DefaultServlet()), "/");
|
||||
|
||||
HandlerList handlers = new HandlerList();
|
||||
handlers.setHandlers(new Handler[] { context, new DefaultHandler() });
|
||||
server.setHandler(handlers);
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -18,13 +18,18 @@
|
|||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||
import org.eclipse.jetty.deploy.PropertiesConfigurationManager;
|
||||
import org.eclipse.jetty.deploy.bindings.DebugListenerBinding;
|
||||
import org.eclipse.jetty.deploy.providers.WebAppProvider;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.DebugListener;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
|
@ -42,15 +47,38 @@ import org.eclipse.jetty.server.handler.StatisticsHandler;
|
|||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
|
||||
/**
|
||||
* Starts the Jetty Distribution's demo-base directory using entirely
|
||||
* embedded jetty techniques.
|
||||
*/
|
||||
public class LikeJettyXml
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
String jetty_home = System.getProperty("jetty.home","../../jetty-distribution/target/distribution");
|
||||
String jetty_base = System.getProperty("jetty.home","../../jetty-distribution/target/distribution/demo-base");
|
||||
System.setProperty("jetty.home",jetty_home);
|
||||
System.setProperty("jetty.base",jetty_base);
|
||||
// Path to as-built jetty-distribution directory
|
||||
String jettyHomeBuild = "../../jetty-distribution/target/distribution";
|
||||
|
||||
// Find jetty home and base directories
|
||||
String homePath = System.getProperty("jetty.home", jettyHomeBuild);
|
||||
File homeDir = new File(homePath);
|
||||
if (!homeDir.exists())
|
||||
{
|
||||
throw new FileNotFoundException(homeDir.getAbsolutePath());
|
||||
}
|
||||
String basePath = System.getProperty("jetty.base", homeDir + "/demo-base");
|
||||
File baseDir = new File(basePath);
|
||||
if(!baseDir.exists())
|
||||
{
|
||||
throw new FileNotFoundException(baseDir.getAbsolutePath());
|
||||
}
|
||||
|
||||
// Configure jetty.home and jetty.base system properties
|
||||
String jetty_home = homeDir.getAbsolutePath();
|
||||
String jetty_base = baseDir.getAbsolutePath();
|
||||
System.setProperty("jetty.home", jetty_home);
|
||||
System.setProperty("jetty.base", jetty_base);
|
||||
|
||||
|
||||
// === jetty.xml ===
|
||||
|
@ -86,14 +114,15 @@ public class LikeJettyXml
|
|||
server.setDumpBeforeStop(false);
|
||||
server.setStopAtShutdown(true);
|
||||
|
||||
|
||||
// === jetty-jmx.xml ===
|
||||
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer);
|
||||
|
||||
|
||||
// === jetty-http.xml ===
|
||||
ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));
|
||||
ServerConnector http = new ServerConnector(server,
|
||||
new HttpConnectionFactory(http_config));
|
||||
http.setPort(8080);
|
||||
http.setIdleTimeout(30000);
|
||||
server.addConnector(http);
|
||||
|
@ -102,15 +131,13 @@ public class LikeJettyXml
|
|||
// === jetty-https.xml ===
|
||||
// SSL Context Factory
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setKeyStorePath(jetty_home + "/../../../jetty-server/src/test/config/etc/keystore");
|
||||
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||
sslContextFactory.setTrustStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setTrustStorePath(jetty_home + "/../../../jetty-server/src/test/config/etc/keystore");
|
||||
sslContextFactory.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setExcludeCipherSuites(
|
||||
"SSL_RSA_WITH_DES_CBC_SHA",
|
||||
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
sslContextFactory.setExcludeCipherSuites("SSL_RSA_WITH_DES_CBC_SHA",
|
||||
"SSL_DHE_RSA_WITH_DES_CBC_SHA", "SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
|
@ -122,7 +149,7 @@ public class LikeJettyXml
|
|||
|
||||
// SSL Connector
|
||||
ServerConnector sslConnector = new ServerConnector(server,
|
||||
new SslConnectionFactory(sslContextFactory,"http/1.1"),
|
||||
new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
|
||||
new HttpConnectionFactory(https_config));
|
||||
sslConnector.setPort(8443);
|
||||
server.addConnector(sslConnector);
|
||||
|
@ -130,8 +157,13 @@ public class LikeJettyXml
|
|||
|
||||
// === jetty-deploy.xml ===
|
||||
DeploymentManager deployer = new DeploymentManager();
|
||||
DebugListener debug = new DebugListener(System.out,true,true,true);
|
||||
server.addBean(debug);
|
||||
deployer.addLifeCycleBinding(new DebugListenerBinding(debug));
|
||||
deployer.setContexts(contexts);
|
||||
deployer.setContextAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",".*/servlet-api-[^/]*\\.jar$");
|
||||
deployer.setContextAttribute(
|
||||
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
|
||||
".*/servlet-api-[^/]*\\.jar$");
|
||||
|
||||
WebAppProvider webapp_provider = new WebAppProvider();
|
||||
webapp_provider.setMonitoredDirName(jetty_base + "/webapps");
|
||||
|
@ -142,7 +174,12 @@ public class LikeJettyXml
|
|||
|
||||
deployer.addAppProvider(webapp_provider);
|
||||
server.addBean(deployer);
|
||||
|
||||
|
||||
// === setup jetty plus ==
|
||||
Configuration.ClassList.setServerDefault(server).addAfter(
|
||||
"org.eclipse.jetty.webapp.FragmentConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.EnvConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
|
||||
// === jetty-stats.xml ===
|
||||
StatisticsHandler stats = new StatisticsHandler();
|
||||
|
@ -179,10 +216,9 @@ public class LikeJettyXml
|
|||
HashLoginService login = new HashLoginService();
|
||||
login.setName("Test Realm");
|
||||
login.setConfig(jetty_base + "/etc/realm.properties");
|
||||
login.setRefreshInterval(0);
|
||||
login.setHotReload(false);
|
||||
server.addBean(login);
|
||||
|
||||
|
||||
|
||||
// Start the server
|
||||
server.start();
|
||||
server.join();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -18,6 +18,10 @@
|
|||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
|
@ -27,70 +31,89 @@ import org.eclipse.jetty.server.ServerConnector;
|
|||
import org.eclipse.jetty.server.SslConnectionFactory;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* A Jetty server with multiple connectors.
|
||||
*/
|
||||
public class ManyConnectors
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Since this example shows off SSL configuration, we need a keystore with the appropriate key. These two
|
||||
// lines are purely a hack to get access to a keystore that we use in many unit tests and should probably be
|
||||
// a direct path to your own keystore (used on line 29).
|
||||
String jetty_home = System.getProperty("jetty.home","../../jetty-distribution/target/distribution");
|
||||
System.setProperty("jetty.home", jetty_home);
|
||||
// Since this example shows off SSL configuration, we need a keystore
|
||||
// with the appropriate key. These lookup of jetty.home is purely a hack
|
||||
// to get access to a keystore that we use in many unit tests and should
|
||||
// probably be a direct path to your own keystore.
|
||||
|
||||
// Create a basic jetty server object without declaring the port. Since we are configuring connectors
|
||||
// directly we'll be setting ports on those connectors.
|
||||
String jettyDistKeystore = "../../jetty-distribution/target/distribution/demo-base/etc/keystore";
|
||||
String keystorePath = System.getProperty(
|
||||
"example.keystore", jettyDistKeystore);
|
||||
File keystoreFile = new File(keystorePath);
|
||||
if (!keystoreFile.exists())
|
||||
{
|
||||
throw new FileNotFoundException(keystoreFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
// Create a basic jetty server object without declaring the port. Since
|
||||
// we are configuring connectors directly we'll be setting ports on
|
||||
// those connectors.
|
||||
Server server = new Server();
|
||||
|
||||
// HTTP Configuration
|
||||
// HttpConfiguration is a collection of configuration information appropriate for http and https. The default
|
||||
// scheme for http is <code>http</code> of course, as the default for secured http is <code>https</code> but
|
||||
// we show setting the scheme to show it can be done. The port for secured communication is also set here.
|
||||
// HttpConfiguration is a collection of configuration information
|
||||
// appropriate for http and https. The default scheme for http is
|
||||
// <code>http</code> of course, as the default for secured http is
|
||||
// <code>https</code> but we show setting the scheme to show it can be
|
||||
// done. The port for secured communication is also set here.
|
||||
HttpConfiguration http_config = new HttpConfiguration();
|
||||
http_config.setSecureScheme("https");
|
||||
http_config.setSecurePort(8443);
|
||||
http_config.setOutputBufferSize(32768);
|
||||
|
||||
// HTTP connector
|
||||
// The first server connector we create is the one for http, passing in the http configuration we configured
|
||||
// above so it can get things like the output buffer size, etc. We also set the port (8080) and configure an
|
||||
// idle timeout.
|
||||
ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));
|
||||
// The first server connector we create is the one for http, passing in
|
||||
// the http configuration we configured above so it can get things like
|
||||
// the output buffer size, etc. We also set the port (8080) and
|
||||
// configure an idle timeout.
|
||||
ServerConnector http = new ServerConnector(server,
|
||||
new HttpConnectionFactory(http_config));
|
||||
http.setPort(8080);
|
||||
http.setIdleTimeout(30000);
|
||||
|
||||
// SSL Context Factory for HTTPS and SPDY
|
||||
// SSL requires a certificate so we configure a factory for ssl contents with information pointing to what
|
||||
// keystore the ssl connection needs to know about. Much more configuration is available the ssl context,
|
||||
// including things like choosing the particular certificate out of a keystore to be used.
|
||||
|
||||
// SSL Context Factory for HTTPS
|
||||
// SSL requires a certificate so we configure a factory for ssl contents
|
||||
// with information pointing to what keystore the ssl connection needs
|
||||
// to know about. Much more configuration is available the ssl context,
|
||||
// including things like choosing the particular certificate out of a
|
||||
// keystore to be used.
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath());
|
||||
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||
|
||||
// HTTPS Configuration
|
||||
// A new HttpConfiguration object is needed for the next connector and you can pass the old one as an
|
||||
// argument to effectively clone the contents. On this HttpConfiguration object we add a
|
||||
// SecureRequestCustomizer which is how a new connector is able to resolve the https connection before
|
||||
// handing control over to the Jetty Server.
|
||||
// A new HttpConfiguration object is needed for the next connector and
|
||||
// you can pass the old one as an argument to effectively clone the
|
||||
// contents. On this HttpConfiguration object we add a
|
||||
// SecureRequestCustomizer which is how a new connector is able to
|
||||
// resolve the https connection before handing control over to the Jetty
|
||||
// Server.
|
||||
HttpConfiguration https_config = new HttpConfiguration(http_config);
|
||||
https_config.addCustomizer(new SecureRequestCustomizer());
|
||||
|
||||
// HTTPS connector
|
||||
// We create a second ServerConnector, passing in the http configuration we just made along with the
|
||||
// previously created ssl context factory. Next we set the port and a longer idle timeout.
|
||||
// We create a second ServerConnector, passing in the http configuration
|
||||
// we just made along with the previously created ssl context factory.
|
||||
// Next we set the port and a longer idle timeout.
|
||||
ServerConnector https = new ServerConnector(server,
|
||||
new SslConnectionFactory(sslContextFactory,"http/1.1"),
|
||||
new HttpConnectionFactory(https_config));
|
||||
new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
|
||||
new HttpConnectionFactory(https_config));
|
||||
https.setPort(8443);
|
||||
https.setIdleTimeout(500000);
|
||||
|
||||
// Here you see the server having multiple connectors registered with it, now requests can flow into the server
|
||||
// from both http and https urls to their respective ports and be processed accordingly by jetty. A simple
|
||||
// handler is also registered with the server so the example has something to pass requests off to.
|
||||
// Here you see the server having multiple connectors registered with
|
||||
// it, now requests can flow into the server from both http and https
|
||||
// urls to their respective ports and be processed accordingly by jetty.
|
||||
// A simple handler is also registered with the server so the example
|
||||
// has something to pass requests off to.
|
||||
|
||||
// Set the connectors
|
||||
server.setConnectors(new Connector[] { http, https });
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -25,7 +25,7 @@ import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
|||
|
||||
public class ManyContexts
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
|
@ -35,16 +35,17 @@ public class ManyContexts
|
|||
|
||||
ContextHandler contextFR = new ContextHandler("/fr");
|
||||
contextFR.setHandler(new HelloHandler("Bonjoir"));
|
||||
|
||||
|
||||
ContextHandler contextIT = new ContextHandler("/it");
|
||||
contextIT.setHandler(new HelloHandler("Bongiorno"));
|
||||
|
||||
ContextHandler contextV = new ContextHandler("/");
|
||||
contextV.setVirtualHosts(new String[]{ "127.0.0.2" });
|
||||
contextV.setVirtualHosts(new String[] { "127.0.0.2" });
|
||||
contextV.setHandler(new HelloHandler("Virtual Hello"));
|
||||
|
||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||
contexts.setHandlers(new Handler[] { context, contextFR, contextIT, contextV });
|
||||
contexts.setHandlers(new Handler[] { context, contextFR, contextIT,
|
||||
contextV });
|
||||
|
||||
server.setHandler(contexts);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -36,9 +36,9 @@ import org.eclipse.jetty.server.handler.HandlerCollection;
|
|||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.server.handler.HandlerWrapper;
|
||||
import org.eclipse.jetty.server.handler.RequestLogHandler;
|
||||
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
||||
import org.eclipse.jetty.util.ajax.JSON;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* Frequently many handlers are combined together to handle different aspects of
|
||||
* a request. A handler may:
|
||||
|
@ -49,7 +49,6 @@ import org.eclipse.jetty.util.ajax.JSON;
|
|||
* <li>select another handler to pass the request to.
|
||||
* <li>use business logic to decide to do one of the above.
|
||||
* </ul>
|
||||
*
|
||||
* Multiple handlers may be combined with:
|
||||
* <ul>
|
||||
* <li>{@link HandlerWrapper} which will nest one handler inside another. In
|
||||
|
@ -68,28 +67,60 @@ import org.eclipse.jetty.util.ajax.JSON;
|
|||
*/
|
||||
public class ManyHandlers
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
/**
|
||||
* Produce output that lists all of the request parameters
|
||||
*/
|
||||
public static class ParamHandler extends AbstractHandler
|
||||
{
|
||||
public void handle( String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response ) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
Map<String, String[]> params = request.getParameterMap();
|
||||
if (params.size() > 0)
|
||||
{
|
||||
response.setContentType("text/plain");
|
||||
response.getWriter().println(JSON.toString(params));
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a request attribute, but produce no output.
|
||||
*/
|
||||
public static class WelcomeWrapHandler extends HandlerWrapper
|
||||
{
|
||||
@Override
|
||||
public void handle( String target,
|
||||
Request baseRequest,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response ) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
request.setAttribute("welcome", "Hello");
|
||||
super.handle(target, baseRequest, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
// create the handlers
|
||||
Handler param = new ParamHandler();
|
||||
HandlerWrapper wrapper = new HandlerWrapper()
|
||||
{
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
request.setAttribute("welcome","Hello");
|
||||
super.handle(target,baseRequest,request,response);
|
||||
}
|
||||
};
|
||||
HandlerWrapper wrapper = new WelcomeWrapHandler();
|
||||
Handler hello = new HelloHandler();
|
||||
Handler dft = new DefaultHandler();
|
||||
RequestLogHandler log = new RequestLogHandler();
|
||||
RequestLogHandler requestLog = new RequestLogHandler();
|
||||
|
||||
// configure logs
|
||||
log.setRequestLog(new NCSARequestLog(File.createTempFile("demo","log").getAbsolutePath()));
|
||||
// configure request logging
|
||||
File requestLogFile = File.createTempFile("demo", "log");
|
||||
NCSARequestLog ncsaLog = new NCSARequestLog(
|
||||
requestLogFile.getAbsolutePath());
|
||||
requestLog.setRequestLog(ncsaLog);
|
||||
|
||||
// create the handler collections
|
||||
HandlerCollection handlers = new HandlerCollection();
|
||||
|
@ -97,28 +128,24 @@ public class ManyHandlers
|
|||
|
||||
// link them all together
|
||||
wrapper.setHandler(hello);
|
||||
list.setHandlers(new Handler[]
|
||||
{ param, wrapper, dft });
|
||||
handlers.setHandlers(new Handler[]
|
||||
{ list, log });
|
||||
list.setHandlers(new Handler[] { param, new GzipHandler(), dft });
|
||||
handlers.setHandlers(new Handler[] { list, requestLog });
|
||||
|
||||
// Handler tree looks like the following
|
||||
// <pre>
|
||||
// Server
|
||||
// + HandlerCollection
|
||||
// . + HandlerList
|
||||
// . | + param (ParamHandler)
|
||||
// . | + wrapper (WelcomeWrapHandler)
|
||||
// . | | \ hello (HelloHandler)
|
||||
// . | \ dft (DefaultHandler)
|
||||
// . \ requestLog (RequestLogHandler)
|
||||
// </pre>
|
||||
|
||||
server.setHandler(handlers);
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
||||
public static class ParamHandler extends AbstractHandler
|
||||
{
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
Map<String,String[]> params = request.getParameterMap();
|
||||
if (params.size() > 0)
|
||||
{
|
||||
response.setContentType("text/plain");
|
||||
response.getWriter().println(JSON.toString(params));
|
||||
((Request)request).setHandled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -18,7 +18,6 @@
|
|||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
|
@ -30,28 +29,35 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
|
||||
public class ManyServletContexts
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
// Setup JMX
|
||||
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer,true);
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer, true);
|
||||
|
||||
// Declare server handler collection
|
||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||
server.setHandler(contexts);
|
||||
|
||||
ServletContextHandler root = new ServletContextHandler(contexts,"/",ServletContextHandler.SESSIONS);
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Hello")),"/");
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Ciao")),"/it/*");
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Bonjoir")),"/fr/*");
|
||||
// Configure context "/" (root) for servlets
|
||||
ServletContextHandler root = new ServletContextHandler(contexts, "/",
|
||||
ServletContextHandler.SESSIONS);
|
||||
// Add servlets to root context
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Hello")), "/");
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Ciao")), "/it/*");
|
||||
root.addServlet(new ServletHolder(new HelloServlet("Bonjoir")), "/fr/*");
|
||||
|
||||
// Configure context "/other" for servlets
|
||||
ServletContextHandler other = new ServletContextHandler(contexts,
|
||||
"/other", ServletContextHandler.SESSIONS);
|
||||
// Add servlets to /other context
|
||||
other.addServlet(DefaultServlet.class.getCanonicalName(), "/");
|
||||
other.addServlet(new ServletHolder(new HelloServlet("YO!")), "*.yo");
|
||||
|
||||
ServletContextHandler other = new ServletContextHandler(contexts,"/other",ServletContextHandler.SESSIONS);
|
||||
other.addServlet(DefaultServlet.class.getCanonicalName(),"/");
|
||||
other.addServlet(new ServletHolder(new HelloServlet("YO!")),"*.yo");
|
||||
|
||||
server.start();
|
||||
server.dumpStdErr();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -30,27 +30,35 @@ import org.eclipse.jetty.servlet.ServletHandler;
|
|||
|
||||
public class MinimalServlets
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Create a basic jetty server object that will listen on port 8080. Note that if you set this to port 0
|
||||
// then a randomly available port will be assigned that you can either look in the logs for the port,
|
||||
// Create a basic jetty server object that will listen on port 8080.
|
||||
// Note that if you set this to port 0 then a randomly available port
|
||||
// will be assigned that you can either look in the logs for the port,
|
||||
// or programmatically obtain it for use in test cases.
|
||||
Server server = new Server(8080);
|
||||
|
||||
// The ServletHandler is a dead simple way to create a context handler that is backed by an instance of a
|
||||
// Servlet. This handler then needs to be registered with the Server object.
|
||||
// The ServletHandler is a dead simple way to create a context handler
|
||||
// that is backed by an instance of a Servlet.
|
||||
// This handler then needs to be registered with the Server object.
|
||||
ServletHandler handler = new ServletHandler();
|
||||
server.setHandler(handler);
|
||||
|
||||
// Passing in the class for the servlet allows jetty to instantite an instance of that servlet and mount it
|
||||
// on a given context path.
|
||||
// Passing in the class for the Servlet allows jetty to instantiate an
|
||||
// instance of that Servlet and mount it on a given context path.
|
||||
|
||||
// !! This is a raw Servlet, not a servlet that has been configured through a web.xml or anything like that !!
|
||||
// IMPORTANT:
|
||||
// This is a raw Servlet, not a Servlet that has been configured
|
||||
// through a web.xml @WebServlet annotation, or anything similar.
|
||||
handler.addServletWithMapping(HelloServlet.class, "/*");
|
||||
|
||||
// Start things up! By using the server.join() the server thread will join with the current thread.
|
||||
// See "http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()" for more details.
|
||||
// Start things up!
|
||||
server.start();
|
||||
|
||||
// The use of server.join() the will make the current thread join and
|
||||
// wait until the server is done executing.
|
||||
// See
|
||||
// http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#join()
|
||||
server.join();
|
||||
}
|
||||
|
||||
|
@ -58,11 +66,13 @@ public class MinimalServlets
|
|||
public static class HelloServlet extends HttpServlet
|
||||
{
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
|
||||
protected void doGet( HttpServletRequest request,
|
||||
HttpServletResponse response ) throws ServletException,
|
||||
IOException
|
||||
{
|
||||
response.setContentType("text/html");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.getWriter().println("<h1>Hello SimpleServlet</h1>");
|
||||
response.getWriter().println("<h1>Hello from HelloServlet</h1>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -21,13 +21,12 @@ package org.eclipse.jetty.embedded;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* A Jetty server with one connectors.
|
||||
*/
|
||||
public class OneConnector
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// The Server
|
||||
Server server = new Server();
|
||||
|
@ -37,7 +36,7 @@ public class OneConnector
|
|||
http.setHost("localhost");
|
||||
http.setPort(8080);
|
||||
http.setIdleTimeout(30000);
|
||||
|
||||
|
||||
// Set the connector
|
||||
server.addConnector(http);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -23,18 +23,20 @@ import org.eclipse.jetty.server.handler.ContextHandler;
|
|||
|
||||
public class OneContext
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
Server server = new Server( 8080 );
|
||||
|
||||
// Add a single handler on context "/hello"
|
||||
ContextHandler context = new ContextHandler();
|
||||
context.setContextPath("/");
|
||||
context.setResourceBase(".");
|
||||
context.setClassLoader(Thread.currentThread().getContextClassLoader());
|
||||
context.setHandler(new HelloHandler());
|
||||
context.setContextPath( "/hello" );
|
||||
context.setHandler( new HelloHandler() );
|
||||
|
||||
server.setHandler(context);
|
||||
// Can be accessed using http://localhost:8080/hello
|
||||
|
||||
server.setHandler( context );
|
||||
|
||||
// Start the server
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -22,7 +22,7 @@ import org.eclipse.jetty.server.Server;
|
|||
|
||||
public class OneHandler
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
server.setHandler(new HelloHandler());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -19,22 +19,26 @@
|
|||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
|
||||
public class OneServletContext
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
Server server = new Server(8080);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||
ServletContextHandler context = new ServletContextHandler(
|
||||
ServletContextHandler.SESSIONS);
|
||||
context.setContextPath("/");
|
||||
context.setResourceBase(System.getProperty("java.io.tmpdir"));
|
||||
server.setHandler(context);
|
||||
|
||||
context.addServlet(org.eclipse.jetty.servlet.DefaultServlet.class,"/");
|
||||
context.addServlet(new ServletHolder(new DumpServlet()),"/dump/*");
|
||||
|
||||
// Add dump servlet
|
||||
context.addServlet(DumpServlet.class, "/dump/*");
|
||||
// Add default servlet
|
||||
context.addServlet(DefaultServlet.class, "/");
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -23,25 +23,29 @@ import java.lang.management.ManagementFactory;
|
|||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.server.ConnectorStatistics;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
|
||||
public class OneServletContextJmxStats
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
server.addBean(new MBeanContainer(ManagementFactory.getPlatformMBeanServer()));
|
||||
Server server = new Server(8080);
|
||||
// Add JMX tracking to Server
|
||||
server.addBean(new MBeanContainer(ManagementFactory
|
||||
.getPlatformMBeanServer()));
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||
ServletContextHandler context = new ServletContextHandler(
|
||||
ServletContextHandler.SESSIONS);
|
||||
context.setContextPath("/");
|
||||
server.setHandler(context);
|
||||
|
||||
context.addServlet(org.eclipse.jetty.servlet.DefaultServlet.class,"/");
|
||||
context.addServlet(new ServletHolder(new DumpServlet()),"/dump/*");
|
||||
context.addServlet(DumpServlet.class, "/dump/*");
|
||||
context.addServlet(DefaultServlet.class, "/");
|
||||
|
||||
// Add Connector Statistics tracking to all connectors
|
||||
ConnectorStatistics.addToAllConnectors(server);
|
||||
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -18,52 +18,54 @@
|
|||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
public class OneWebApp
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Create a basic jetty server object that will listen on port 8080. Note that if you set this to port 0 then
|
||||
// a randomly available port will be assigned that you can either look in the logs for the port,
|
||||
// Create a basic jetty server object that will listen on port 8080.
|
||||
// Note that if you set this to port 0 then a randomly available port
|
||||
// will be assigned that you can either look in the logs for the port,
|
||||
// or programmatically obtain it for use in test cases.
|
||||
Server server = new Server(8080);
|
||||
|
||||
|
||||
// Setup JMX
|
||||
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer);
|
||||
|
||||
// The WebAppContext is the entity that controls the environment in which a web application lives and
|
||||
// breathes. In this example the context path is being set to "/" so it is suitable for serving root context
|
||||
// requests and then we see it setting the location of the war. A whole host of other configurations are
|
||||
// available, ranging from configuring to support annotation scanning in the webapp (through
|
||||
// The WebAppContext is the entity that controls the environment in
|
||||
// which a web application lives and breathes. In this example the
|
||||
// context path is being set to "/" so it is suitable for serving root
|
||||
// context requests and then we see it setting the location of the war.
|
||||
// A whole host of other configurations are available, ranging from
|
||||
// configuring to support annotation scanning in the webapp (through
|
||||
// PlusConfiguration) to choosing where the webapp will unpack itself.
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
webapp.setWar("../../jetty-distribution/target/distribution/demo-base/webapps/test.war");
|
||||
File warFile = new File(
|
||||
"../../jetty-distribution/target/distribution/test/webapps/test/");
|
||||
webapp.setWar(warFile.getAbsolutePath());
|
||||
webapp.addAliasCheck(new AllowSymLinkAliasChecker());
|
||||
|
||||
// A WebAppContext is a ContextHandler as well so it needs to be set to the server so it is aware of where to
|
||||
// send the appropriate requests.
|
||||
// A WebAppContext is a ContextHandler as well so it needs to be set to
|
||||
// the server so it is aware of where to send the appropriate requests.
|
||||
server.setHandler(webapp);
|
||||
|
||||
// Configure a LoginService
|
||||
// Since this example is for our test webapp, we need to setup a LoginService so this shows how to create a
|
||||
// very simple hashmap based one. The name of the LoginService needs to correspond to what is configured in
|
||||
// the webapp's web.xml and since it has a lifecycle of its own we register it as a bean with the Jetty
|
||||
// server object so it can be started and stopped according to the lifecycle of the server itself.
|
||||
HashLoginService loginService = new HashLoginService();
|
||||
loginService.setName("Test Realm");
|
||||
loginService.setConfig("src/test/resources/realm.properties");
|
||||
server.addBean(loginService);
|
||||
|
||||
// Start things up! By using the server.join() the server thread will join with the current thread.
|
||||
// See "http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()" for more details.
|
||||
// Start things up!
|
||||
server.start();
|
||||
|
||||
// The use of server.join() the will make the current thread join and
|
||||
// wait until the server is done executing.
|
||||
// See http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#join()
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
public class OneWebAppWithJsp
|
||||
{
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Create a basic jetty server object that will listen on port 8080.
|
||||
// Note that if you set this to port 0 then
|
||||
// a randomly available port will be assigned that you can either look
|
||||
// in the logs for the port,
|
||||
// or programmatically obtain it for use in test cases.
|
||||
Server server = new Server( 8080 );
|
||||
|
||||
// Setup JMX
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer() );
|
||||
server.addBean( mbContainer );
|
||||
|
||||
// The WebAppContext is the entity that controls the environment in
|
||||
// which a web application lives and
|
||||
// breathes. In this example the context path is being set to "/" so it
|
||||
// is suitable for serving root context
|
||||
// requests and then we see it setting the location of the war. A whole
|
||||
// host of other configurations are
|
||||
// available, ranging from configuring to support annotation scanning in
|
||||
// the webapp (through
|
||||
// PlusConfiguration) to choosing where the webapp will unpack itself.
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath( "/" );
|
||||
File warFile = new File(
|
||||
"../../jetty-distribution/target/distribution/demo-base/webapps/test.war" );
|
||||
if (!warFile.exists())
|
||||
{
|
||||
throw new RuntimeException( "Unable to find WAR File: "
|
||||
+ warFile.getAbsolutePath() );
|
||||
}
|
||||
webapp.setWar( warFile.getAbsolutePath() );
|
||||
|
||||
// This webapp will use jsps and jstl. We need to enable the
|
||||
// AnnotationConfiguration in order to correctly
|
||||
// set up the jsp container
|
||||
Configuration.ClassList classlist = Configuration.ClassList
|
||||
.setServerDefault( server );
|
||||
classlist.addBefore(
|
||||
"org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
|
||||
"org.eclipse.jetty.annotations.AnnotationConfiguration" );
|
||||
|
||||
// Set the ContainerIncludeJarPattern so that jetty examines these
|
||||
// container-path jars for tlds, web-fragments etc.
|
||||
// If you omit the jar that contains the jstl .tlds, the jsp engine will
|
||||
// scan for them instead.
|
||||
webapp.setAttribute(
|
||||
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
|
||||
".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$" );
|
||||
|
||||
// A WebAppContext is a ContextHandler as well so it needs to be set to
|
||||
// the server so it is aware of where to
|
||||
// send the appropriate requests.
|
||||
server.setHandler( webapp );
|
||||
|
||||
// Configure a LoginService.
|
||||
// Since this example is for our test webapp, we need to setup a
|
||||
// LoginService so this shows how to create a very simple hashmap based
|
||||
// one. The name of the LoginService needs to correspond to what is
|
||||
// configured in the webapp's web.xml and since it has a lifecycle of
|
||||
// its own we register it as a bean with the Jetty server object so it
|
||||
// can be started and stopped according to the lifecycle of the server
|
||||
// itself.
|
||||
HashLoginService loginService = new HashLoginService();
|
||||
loginService.setName( "Test Realm" );
|
||||
loginService.setConfig( "src/test/resources/realm.properties" );
|
||||
server.addBean( loginService );
|
||||
|
||||
// Start things up!
|
||||
server.start();
|
||||
|
||||
// The use of server.join() the will make the current thread join and
|
||||
// wait until the server is done executing.
|
||||
// See http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#join()
|
||||
server.join();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -27,7 +27,7 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
|||
|
||||
public class ProxyServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server();
|
||||
ServerConnector connector = new ServerConnector(server);
|
||||
|
@ -39,7 +39,8 @@ public class ProxyServer
|
|||
server.setHandler(proxy);
|
||||
|
||||
// Setup proxy servlet
|
||||
ServletContextHandler context = new ServletContextHandler(proxy, "/", ServletContextHandler.SESSIONS);
|
||||
ServletContextHandler context = new ServletContextHandler(proxy, "/",
|
||||
ServletContextHandler.SESSIONS);
|
||||
ServletHolder proxyServlet = new ServletHolder(ProxyServlet.class);
|
||||
proxyServlet.setInitParameter("blackList", "www.eclipse.org");
|
||||
context.addServlet(proxyServlet, "/*");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -30,59 +30,75 @@ import org.eclipse.jetty.util.security.Constraint;
|
|||
|
||||
public class SecuredHelloHandler
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Create a basic jetty server object that will listen on port 8080. Note that if you set this to port 0
|
||||
// then a randomly available port will be assigned that you can either look in the logs for the port,
|
||||
// Create a basic jetty server object that will listen on port 8080.
|
||||
// Note that if you set this to port 0 then a randomly available port
|
||||
// will be assigned that you can either look in the logs for the port,
|
||||
// or programmatically obtain it for use in test cases.
|
||||
Server server = new Server(8080);
|
||||
|
||||
// Since this example is for our test webapp, we need to setup a LoginService so this shows how to create a
|
||||
// very simple hashmap based one. The name of the LoginService needs to correspond to what is configured a
|
||||
// webapp's web.xml and since it has a lifecycle of its own we register it as a bean with the Jetty server
|
||||
// object so it can be started and stopped according to the lifecycle of the server itself. In this example
|
||||
// the name can be whatever you like since we are not dealing with webapp realms.
|
||||
LoginService loginService = new HashLoginService("MyRealm","src/test/resources/realm.properties");
|
||||
server.addBean(loginService);
|
||||
// Since this example is for our test webapp, we need to setup a
|
||||
// LoginService so this shows how to create a very simple hashmap based
|
||||
// one. The name of the LoginService needs to correspond to what is
|
||||
// configured a webapp's web.xml and since it has a lifecycle of its own
|
||||
// we register it as a bean with the Jetty server object so it can be
|
||||
// started and stopped according to the lifecycle of the server itself.
|
||||
// In this example the name can be whatever you like since we are not
|
||||
// dealing with webapp realms.
|
||||
LoginService loginService = new HashLoginService("MyRealm",
|
||||
"src/test/resources/realm.properties");
|
||||
server.addBean(loginService);
|
||||
|
||||
// A security handler is a jetty handler that secures content behind a particular portion of a url space. The
|
||||
// ConstraintSecurityHandler is a more specialized handler that allows matching of urls to different
|
||||
// A security handler is a jetty handler that secures content behind a
|
||||
// particular portion of a url space. The ConstraintSecurityHandler is a
|
||||
// more specialized handler that allows matching of urls to different
|
||||
// constraints. The server sets this as the first handler in the chain,
|
||||
// effectively applying these constraints to all subsequent handlers in the chain.
|
||||
// effectively applying these constraints to all subsequent handlers in
|
||||
// the chain.
|
||||
ConstraintSecurityHandler security = new ConstraintSecurityHandler();
|
||||
server.setHandler(security);
|
||||
|
||||
// This constraint requires authentication and in addition that an authenticated user be a member of a given
|
||||
// set of roles for authorization purposes.
|
||||
// This constraint requires authentication and in addition that an
|
||||
// authenticated user be a member of a given set of roles for
|
||||
// authorization purposes.
|
||||
Constraint constraint = new Constraint();
|
||||
constraint.setName("auth");
|
||||
constraint.setAuthenticate( true );
|
||||
constraint.setRoles(new String[]{"user", "admin"});
|
||||
constraint.setAuthenticate(true);
|
||||
constraint.setRoles(new String[] { "user", "admin" });
|
||||
|
||||
// Binds a url pattern with the previously created constraint. The roles for this constraing mapping are
|
||||
// mined from the Constraint itself although methods exist to declare and bind roles separately as well.
|
||||
// Binds a url pattern with the previously created constraint. The roles
|
||||
// for this constraing mapping are mined from the Constraint itself
|
||||
// although methods exist to declare and bind roles separately as well.
|
||||
ConstraintMapping mapping = new ConstraintMapping();
|
||||
mapping.setPathSpec( "/*" );
|
||||
mapping.setConstraint( constraint );
|
||||
mapping.setPathSpec("/*");
|
||||
mapping.setConstraint(constraint);
|
||||
|
||||
// First you see the constraint mapping being applied to the handler as a singleton list,
|
||||
// however you can passing in as many security constraint mappings as you like so long as they follow the
|
||||
// mapping requirements of the servlet api. Next we set a BasicAuthenticator instance which is the object
|
||||
// that actually checks the credentials followed by the LoginService which is the store of known users, etc.
|
||||
// First you see the constraint mapping being applied to the handler as
|
||||
// a singleton list, however you can passing in as many security
|
||||
// constraint mappings as you like so long as they follow the mapping
|
||||
// requirements of the servlet api. Next we set a BasicAuthenticator
|
||||
// instance which is the object that actually checks the credentials
|
||||
// followed by the LoginService which is the store of known users, etc.
|
||||
security.setConstraintMappings(Collections.singletonList(mapping));
|
||||
security.setAuthenticator(new BasicAuthenticator());
|
||||
security.setLoginService(loginService);
|
||||
|
||||
// The Hello Handler is the handler we are securing so we create one, and then set it as the handler on the
|
||||
// The Hello Handler is the handler we are securing so we create one,
|
||||
// and then set it as the handler on the
|
||||
// security handler to complain the simple handler chain.
|
||||
HelloHandler hh = new HelloHandler();
|
||||
|
||||
// chain the hello handler into the security handler
|
||||
security.setHandler(hh);
|
||||
|
||||
// Start things up! By using the server.join() the server thread will join with the current thread.
|
||||
// See "http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()" for more details.
|
||||
// Start things up!
|
||||
server.start();
|
||||
|
||||
// The use of server.join() the will make the current thread join and
|
||||
// wait until the server is done executing.
|
||||
// See
|
||||
// http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#join()
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -16,55 +16,65 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.jetty.plus.jndi.EnvEntry;
|
||||
import org.eclipse.jetty.plus.jndi.Resource;
|
||||
import org.eclipse.jetty.plus.jndi.Transaction;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* ServerWithAnnotations
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ServerWithAnnotations
|
||||
{
|
||||
public static final void main(String args[]) throws Exception
|
||||
public static final void main( String args[] ) throws Exception
|
||||
{
|
||||
//Create the server
|
||||
// Create the server
|
||||
Server server = new Server(8080);
|
||||
|
||||
//Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
org.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");
|
||||
|
||||
//Create a WebApp
|
||||
// Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
Configuration.ClassList classlist = Configuration.ClassList
|
||||
.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.EnvConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
classlist.addBefore(
|
||||
"org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
|
||||
"org.eclipse.jetty.annotations.AnnotationConfiguration");
|
||||
|
||||
// Create a WebApp
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
webapp.setWar("../../tests/test-webapps/test-servlet-spec/test-spec-webapp/target/test-spec-webapp-9.1.0-SNAPSHOT.war");
|
||||
webapp.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$");
|
||||
File warFile = new File(
|
||||
"../../jetty-distribution/target/distribution/demo-base/webapps/test.war");
|
||||
webapp.setWar(warFile.getAbsolutePath());
|
||||
webapp.setAttribute(
|
||||
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
|
||||
".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$");
|
||||
server.setHandler(webapp);
|
||||
|
||||
//Register new transaction manager in JNDI
|
||||
//At runtime, the webapp accesses this as java:comp/UserTransaction
|
||||
org.eclipse.jetty.plus.jndi.Transaction transactionMgr = new org.eclipse.jetty.plus.jndi.Transaction(new com.acme.MockUserTransaction());
|
||||
// Register new transaction manager in JNDI
|
||||
// At runtime, the webapp accesses this as java:comp/UserTransaction
|
||||
new Transaction(new com.acme.MockUserTransaction());
|
||||
|
||||
// Define an env entry with webapp scope.
|
||||
new EnvEntry(webapp, "maxAmount", new Double(100), true);
|
||||
|
||||
// Register a mock DataSource scoped to the webapp
|
||||
new Resource(webapp, "jdbc/mydatasource", new com.acme.MockDataSource());
|
||||
|
||||
//Define an env entry with webapp scope.
|
||||
org.eclipse.jetty.plus.jndi.EnvEntry maxAmount = new org.eclipse.jetty.plus.jndi.EnvEntry (webapp, "maxAmount", new Double(100), true);
|
||||
|
||||
|
||||
// Register a mock DataSource scoped to the webapp
|
||||
org.eclipse.jetty.plus.jndi.Resource mydatasource = new org.eclipse.jetty.plus.jndi.Resource(webapp, "jdbc/mydatasource", new com.acme.MockDataSource());
|
||||
|
||||
// Configure a LoginService
|
||||
HashLoginService loginService = new HashLoginService();
|
||||
loginService.setName("Test Realm");
|
||||
loginService.setConfig("src/test/resources/realm.properties");
|
||||
server.addBean(loginService);
|
||||
|
||||
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import javax.management.remote.JMXServiceURL;
|
||||
|
||||
import org.eclipse.jetty.jmx.ConnectorServer;
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
|
||||
/**
|
||||
* The simplest possible Jetty server.
|
||||
*/
|
||||
public class ServerWithJMX
|
||||
{
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// === jetty-jmx.xml ===
|
||||
MBeanContainer mbContainer = new MBeanContainer(
|
||||
ManagementFactory.getPlatformMBeanServer());
|
||||
|
||||
Server server = new Server(8080);
|
||||
server.addBean(mbContainer);
|
||||
|
||||
ConnectorServer jmx = new ConnectorServer(
|
||||
new JMXServiceURL(
|
||||
"rmi",
|
||||
null,
|
||||
1999,
|
||||
"/jndi/rmi://localhost:1999/jmxrmi"),
|
||||
"org.eclipse.jetty.jmx:name=rmiconnectorserver");
|
||||
server.addBean(jmx);
|
||||
|
||||
server.start();
|
||||
server.dumpStdErr();
|
||||
server.join();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -16,96 +16,100 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* ServerWithJNDI
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ServerWithJNDI
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
|
||||
//Create the server
|
||||
// Create the server
|
||||
Server server = new Server(8080);
|
||||
|
||||
//Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
org.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
|
||||
//Create a WebApp
|
||||
// Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
Configuration.ClassList classlist = Configuration.ClassList
|
||||
.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.EnvConfiguration",
|
||||
"org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
|
||||
// Create a WebApp
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
webapp.setWar("../../tests/test-webapps/test-jndi-webapp/target/test-jndi-webapp-9.0.4-SNAPSHOT.war");
|
||||
File warFile = new File(
|
||||
"../../jetty-distribution/target/distribution/demo-base/webapps/test.war");
|
||||
webapp.setWar(warFile.getAbsolutePath());
|
||||
server.setHandler(webapp);
|
||||
|
||||
//Register new transaction manager in JNDI
|
||||
//At runtime, the webapp accesses this as java:comp/UserTransaction
|
||||
org.eclipse.jetty.plus.jndi.Transaction transactionMgr = new org.eclipse.jetty.plus.jndi.Transaction(new com.acme.MockUserTransaction());
|
||||
// Register new transaction manager in JNDI
|
||||
// At runtime, the webapp accesses this as java:comp/UserTransaction
|
||||
new org.eclipse.jetty.plus.jndi.Transaction(
|
||||
new com.acme.MockUserTransaction());
|
||||
|
||||
//Define an env entry with Server scope.
|
||||
//At runtime, the webapp accesses this as java:comp/env/woggle
|
||||
//This is equivalent to putting an env-entry in web.xml:
|
||||
//<env-entry>
|
||||
// <env-entry-name>woggle</env-entry-name>
|
||||
// <env-entry-type>java.lang.Integer</env-entry-type>
|
||||
// <env-entry-value>4000</env-entry-value>
|
||||
//</env-entry>
|
||||
org.eclipse.jetty.plus.jndi.EnvEntry woggle = new org.eclipse.jetty.plus.jndi.EnvEntry(server, "woggle", new Integer(4000), false);
|
||||
// Define an env entry with Server scope.
|
||||
// At runtime, the webapp accesses this as java:comp/env/woggle
|
||||
// This is equivalent to putting an env-entry in web.xml:
|
||||
// <env-entry>
|
||||
// <env-entry-name>woggle</env-entry-name>
|
||||
// <env-entry-type>java.lang.Integer</env-entry-type>
|
||||
// <env-entry-value>4000</env-entry-value>
|
||||
// </env-entry>
|
||||
new org.eclipse.jetty.plus.jndi.EnvEntry(server, "woggle", new Integer(4000), false);
|
||||
|
||||
// Define an env entry with webapp scope.
|
||||
// At runtime, the webapp accesses this as java:comp/env/wiggle
|
||||
// This is equivalent to putting a web.xml entry in web.xml:
|
||||
// <env-entry>
|
||||
// <env-entry-name>wiggle</env-entry-name>
|
||||
// <env-entry-value>100</env-entry-value>
|
||||
// <env-entry-type>java.lang.Double</env-entry-type>
|
||||
// </env-entry>
|
||||
// Note that the last arg of "true" means that this definition for
|
||||
// "wiggle" would override an entry of the
|
||||
// same name in web.xml
|
||||
new org.eclipse.jetty.plus.jndi.EnvEntry(webapp, "wiggle", new Double(100), true);
|
||||
|
||||
//Define an env entry with webapp scope.
|
||||
//At runtime, the webapp accesses this as java:comp/env/wiggle
|
||||
//This is equivalent to putting a web.xml entry in web.xml:
|
||||
//<env-entry>
|
||||
// <env-entry-name>wiggle</env-entry-name>
|
||||
// <env-entry-value>100</env-entry-value>
|
||||
// <env-entry-type>java.lang.Double</env-entry-type>
|
||||
//</env-entry>
|
||||
//Note that the last arg of "true" means that this definition for "wiggle" would override an entry of the
|
||||
//same name in web.xml
|
||||
org.eclipse.jetty.plus.jndi.EnvEntry wiggle = new org.eclipse.jetty.plus.jndi.EnvEntry(webapp, "wiggle", new Double(100), true);
|
||||
|
||||
//Register a reference to a mail service scoped to the webapp.
|
||||
//This must be linked to the webapp by an entry in web.xml:
|
||||
// Register a reference to a mail service scoped to the webapp.
|
||||
// This must be linked to the webapp by an entry in web.xml:
|
||||
// <resource-ref>
|
||||
// <res-ref-name>mail/Session</res-ref-name>
|
||||
// <res-type>javax.mail.Session</res-type>
|
||||
// <res-auth>Container</res-auth>
|
||||
// <res-ref-name>mail/Session</res-ref-name>
|
||||
// <res-type>javax.mail.Session</res-type>
|
||||
// <res-auth>Container</res-auth>
|
||||
// </resource-ref>
|
||||
//At runtime the webapp accesses this as java:comp/env/mail/Session
|
||||
// At runtime the webapp accesses this as java:comp/env/mail/Session
|
||||
org.eclipse.jetty.jndi.factories.MailSessionReference mailref = new org.eclipse.jetty.jndi.factories.MailSessionReference();
|
||||
mailref.setUser("CHANGE-ME");
|
||||
mailref.setPassword("CHANGE-ME");
|
||||
Properties props = new Properties();
|
||||
props.put("mail.smtp.auth", "false");
|
||||
props.put("mail.smtp.host","CHANGE-ME");
|
||||
props.put("mail.from","CHANGE-ME");
|
||||
props.put("mail.smtp.host", "CHANGE-ME");
|
||||
props.put("mail.from", "CHANGE-ME");
|
||||
props.put("mail.debug", "false");
|
||||
mailref.setProperties(props);
|
||||
org.eclipse.jetty.plus.jndi.Resource xxxmail = new org.eclipse.jetty.plus.jndi.Resource(webapp, "mail/Session", mailref);
|
||||
|
||||
new org.eclipse.jetty.plus.jndi.Resource(webapp, "mail/Session", mailref);
|
||||
|
||||
// Register a mock DataSource scoped to the webapp
|
||||
// This must be linked to the webapp via an entry in web.xml:
|
||||
// <resource-ref>
|
||||
// <res-ref-name>jdbc/mydatasource</res-ref-name>
|
||||
// <res-type>javax.sql.DataSource</res-type>
|
||||
// <res-auth>Container</res-auth>
|
||||
// </resource-ref>
|
||||
// At runtime the webapp accesses this as
|
||||
// java:comp/env/jdbc/mydatasource
|
||||
new org.eclipse.jetty.plus.jndi.Resource(
|
||||
webapp, "jdbc/mydatasource", new com.acme.MockDataSource());
|
||||
|
||||
// Register a mock DataSource scoped to the webapp
|
||||
//This must be linked to the webapp via an entry in web.xml:
|
||||
//<resource-ref>
|
||||
// <res-ref-name>jdbc/mydatasource</res-ref-name>
|
||||
// <res-type>javax.sql.DataSource</res-type>
|
||||
// <res-auth>Container</res-auth>
|
||||
//</resource-ref>
|
||||
//At runtime the webapp accesses this as java:comp/env/jdbc/mydatasource
|
||||
org.eclipse.jetty.plus.jndi.Resource mydatasource = new org.eclipse.jetty.plus.jndi.Resource(webapp, "jdbc/mydatasource",
|
||||
new com.acme.MockDataSource());
|
||||
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -20,15 +20,16 @@ package org.eclipse.jetty.embedded;
|
|||
|
||||
import org.eclipse.jetty.server.Server;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** The simplest possible Jetty server.
|
||||
/**
|
||||
* The simplest possible Jetty server.
|
||||
*/
|
||||
public class SimplestServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
server.start();
|
||||
server.dumpStdErr();
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
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.spdy.server.NPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.SPDYServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* A Jetty server with HTTP and SPDY connectors.
|
||||
*/
|
||||
public class SpdyConnector
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
String jetty_home = System.getProperty("jetty.home","../../jetty-distribution/target/distribution");
|
||||
System.setProperty("jetty.home", jetty_home);
|
||||
|
||||
// The Server
|
||||
Server server = new Server();
|
||||
|
||||
// HTTP Configuration
|
||||
HttpConfiguration http_config = new HttpConfiguration();
|
||||
http_config.setSecureScheme("https");
|
||||
http_config.setSecurePort(8443);
|
||||
|
||||
// HTTP connector
|
||||
ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));
|
||||
http.setPort(8080);
|
||||
server.addConnector(http);
|
||||
|
||||
// SSL Context Factory for HTTPS and SPDY
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||
|
||||
// HTTPS Configuration
|
||||
HttpConfiguration https_config = new HttpConfiguration(http_config);
|
||||
https_config.addCustomizer(new SecureRequestCustomizer());
|
||||
|
||||
// SPDY versions
|
||||
HTTPSPDYServerConnectionFactory spdy2 =
|
||||
new HTTPSPDYServerConnectionFactory(2,https_config);
|
||||
|
||||
HTTPSPDYServerConnectionFactory spdy3 =
|
||||
new HTTPSPDYServerConnectionFactory(3,https_config,new ReferrerPushStrategy());
|
||||
|
||||
// NPN Factory
|
||||
SPDYServerConnectionFactory.checkNPNAvailable();
|
||||
NPNServerConnectionFactory npn =
|
||||
new NPNServerConnectionFactory(spdy3.getProtocol(),spdy2.getProtocol(),http.getDefaultProtocol());
|
||||
npn.setDefaultProtocol(http.getDefaultProtocol());
|
||||
|
||||
// SSL Factory
|
||||
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,npn.getProtocol());
|
||||
|
||||
// SPDY Connector
|
||||
ServerConnector spdyConnector =
|
||||
new ServerConnector(server,ssl,npn,spdy3,spdy2,new HttpConnectionFactory(https_config));
|
||||
spdyConnector.setPort(8443);
|
||||
server.addConnector(spdyConnector);
|
||||
|
||||
// Set a handler
|
||||
server.setHandler(new HelloHandler());
|
||||
|
||||
// Start the server
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
}
|
|
@ -1,184 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
|
||||
import org.eclipse.jetty.deploy.DeploymentManager;
|
||||
import org.eclipse.jetty.deploy.providers.WebAppProvider;
|
||||
import org.eclipse.jetty.jmx.MBeanContainer;
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.AsyncNCSARequestLog;
|
||||
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.NCSARequestLog;
|
||||
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.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.RequestLogHandler;
|
||||
import org.eclipse.jetty.server.handler.StatisticsHandler;
|
||||
import org.eclipse.jetty.spdy.server.NPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.SPDYServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.server.http.PushStrategy;
|
||||
import org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
|
||||
public class SpdyServer
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
String jetty_home = System.getProperty("jetty.home","../../jetty-distribution/target/distribution");
|
||||
System.setProperty("jetty.home",jetty_home);
|
||||
|
||||
// Setup Threadpool
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool(512);
|
||||
|
||||
// Setup Jetty Server instance
|
||||
Server server = new Server(threadPool);
|
||||
server.manage(threadPool);
|
||||
server.setDumpAfterStart(false);
|
||||
server.setDumpBeforeStop(false);
|
||||
|
||||
// Setup JMX
|
||||
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
|
||||
server.addBean(mbContainer);
|
||||
|
||||
|
||||
// Common HTTP configuration
|
||||
HttpConfiguration config = new HttpConfiguration();
|
||||
config.setSecurePort(8443);
|
||||
config.addCustomizer(new ForwardedRequestCustomizer());
|
||||
config.addCustomizer(new SecureRequestCustomizer());
|
||||
config.setSendServerVersion(true);
|
||||
|
||||
|
||||
// Http Connector Setup
|
||||
|
||||
// A plain HTTP connector listening on port 8080. Note that it's also possible to have port 8080 configured as
|
||||
// a non SSL SPDY connector. But the specification and most browsers do not allow to use SPDY without SSL
|
||||
// encryption. However some browsers allow it to be configured.
|
||||
HttpConnectionFactory http = new HttpConnectionFactory(config);
|
||||
ServerConnector httpConnector = new ServerConnector(server,http);
|
||||
httpConnector.setPort(8080);
|
||||
httpConnector.setIdleTimeout(10000);
|
||||
server.addConnector(httpConnector);
|
||||
|
||||
// SSL configurations
|
||||
|
||||
// We need a SSLContextFactory for the SSL encryption. That SSLContextFactory will be used by the SPDY
|
||||
// connector.
|
||||
SslContextFactory sslContextFactory = new SslContextFactory();
|
||||
sslContextFactory.setKeyStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
|
||||
sslContextFactory.setTrustStorePath(jetty_home + "/etc/keystore");
|
||||
sslContextFactory.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
|
||||
sslContextFactory.setExcludeCipherSuites(
|
||||
"SSL_RSA_WITH_DES_CBC_SHA",
|
||||
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
|
||||
"SSL_DHE_DSS_WITH_DES_CBC_SHA",
|
||||
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
|
||||
"SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
|
||||
"SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
|
||||
|
||||
|
||||
// Spdy Connector
|
||||
|
||||
// Make sure that the required NPN implementations are available.
|
||||
SPDYServerConnectionFactory.checkNPNAvailable();
|
||||
|
||||
// A ReferrerPushStrategy is being initialized.
|
||||
// See: http://www.eclipse.org/jetty/documentation/current/spdy-configuring-push.html for more details.
|
||||
PushStrategy push = new ReferrerPushStrategy();
|
||||
HTTPSPDYServerConnectionFactory spdy2 = new HTTPSPDYServerConnectionFactory(2,config,push);
|
||||
spdy2.setInputBufferSize(8192);
|
||||
spdy2.setInitialWindowSize(32768);
|
||||
|
||||
// We need a connection factory per protocol that our server is supposed to support on the NPN port. We then
|
||||
// create a ServerConnector and pass in the supported factories. NPN will then be used to negotiate the
|
||||
// protocol with the client.
|
||||
HTTPSPDYServerConnectionFactory spdy3 = new HTTPSPDYServerConnectionFactory(3,config,push);
|
||||
spdy2.setInputBufferSize(8192);
|
||||
|
||||
NPNServerConnectionFactory npn = new NPNServerConnectionFactory(spdy3.getProtocol(),spdy2.getProtocol(),http.getProtocol());
|
||||
npn.setDefaultProtocol(http.getProtocol());
|
||||
npn.setInputBufferSize(1024);
|
||||
|
||||
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,npn.getProtocol());
|
||||
|
||||
// Setup the npn connector on port 8443
|
||||
ServerConnector spdyConnector = new ServerConnector(server,ssl,npn,spdy3,spdy2,http);
|
||||
spdyConnector.setPort(8443);
|
||||
|
||||
server.addConnector(spdyConnector);
|
||||
|
||||
// The following section adds some handlers, deployers and webapp providers.
|
||||
// See: http://www.eclipse.org/jetty/documentation/current/advanced-embedding.html for details.
|
||||
|
||||
// Setup handlers
|
||||
HandlerCollection handlers = new HandlerCollection();
|
||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||
RequestLogHandler requestLogHandler = new RequestLogHandler();
|
||||
|
||||
handlers.setHandlers(new Handler[] { contexts, new DefaultHandler(), requestLogHandler });
|
||||
|
||||
StatisticsHandler stats = new StatisticsHandler();
|
||||
stats.setHandler(handlers);
|
||||
|
||||
server.setHandler(stats);
|
||||
|
||||
// Setup deployers
|
||||
DeploymentManager deployer = new DeploymentManager();
|
||||
deployer.setContexts(contexts);
|
||||
server.addBean(deployer);
|
||||
|
||||
WebAppProvider webapp_provider = new WebAppProvider();
|
||||
webapp_provider.setMonitoredDirName(jetty_home + "/webapps");
|
||||
webapp_provider.setParentLoaderPriority(false);
|
||||
webapp_provider.setExtractWars(true);
|
||||
webapp_provider.setScanInterval(2);
|
||||
webapp_provider.setDefaultsDescriptor(jetty_home + "/etc/webdefault.xml");
|
||||
deployer.addAppProvider(webapp_provider);
|
||||
|
||||
HashLoginService login = new HashLoginService();
|
||||
login.setName("Test Realm");
|
||||
login.setConfig(jetty_home + "/etc/realm.properties");
|
||||
server.addBean(login);
|
||||
|
||||
NCSARequestLog requestLog = new AsyncNCSARequestLog();
|
||||
requestLog.setFilename(jetty_home + "/logs/jetty-yyyy_mm_dd.log");
|
||||
requestLog.setExtended(false);
|
||||
requestLogHandler.setRequestLog(requestLog);
|
||||
|
||||
server.setStopAtShutdown(true);
|
||||
|
||||
server.start();
|
||||
server.dumpStdErr();
|
||||
server.join();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -18,6 +18,8 @@
|
|||
|
||||
package org.eclipse.jetty.embedded;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
|
@ -28,56 +30,64 @@ import org.eclipse.jetty.server.handler.ResourceHandler;
|
|||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* A {@link ContextHandlerCollection} handler may be used to direct a request to
|
||||
* a specific Context. The URI path prefix and optional virtual host is used to
|
||||
* select the context.
|
||||
*
|
||||
*/
|
||||
public class SplitFileServer
|
||||
{
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
// Create the Server object and a corresponding ServerConnector and then set the port for the connector. In
|
||||
// this example the server will listen on port 8090. If you set this to port 0 then when the server has been
|
||||
// started you can called connector.getLocalPort() to programmatically get the port the server started on.
|
||||
// Create the Server object and a corresponding ServerConnector and then
|
||||
// set the port for the connector. In this example the server will
|
||||
// listen on port 8090. If you set this to port 0 then when the server
|
||||
// has been started you can called connector.getLocalPort() to
|
||||
// programmatically get the port the server started on.
|
||||
Server server = new Server();
|
||||
ServerConnector connector = new ServerConnector(server);
|
||||
connector.setPort(8090);
|
||||
server.setConnectors(new Connector[]
|
||||
{ connector });
|
||||
server.setConnectors(new Connector[] { connector });
|
||||
|
||||
// Create a Context Handler and ResourceHandler. The ContextHandler is getting set to "/" path but this could
|
||||
// be anything you like for builing out your url. Note how we are setting the ResourceBase using our jetty
|
||||
// maven testing utilities to get the proper resource directory, you needn't use these,
|
||||
// you simply need to supply the paths you are looking to serve content from.
|
||||
// Create a Context Handler and ResourceHandler. The ContextHandler is
|
||||
// getting set to "/" path but this could be anything you like for
|
||||
// builing out your url. Note how we are setting the ResourceBase using
|
||||
// our jetty maven testing utilities to get the proper resource
|
||||
// directory, you needn't use these, you simply need to supply the paths
|
||||
// you are looking to serve content from.
|
||||
ContextHandler context0 = new ContextHandler();
|
||||
context0.setContextPath("/");
|
||||
ResourceHandler rh0 = new ResourceHandler();
|
||||
rh0.setBaseResource( Resource.newResource(MavenTestingUtils.getTestResourceDir("dir0")));
|
||||
File dir0 = MavenTestingUtils.getTestResourceDir("dir0");
|
||||
rh0.setBaseResource(Resource.newResource(dir0));
|
||||
context0.setHandler(rh0);
|
||||
|
||||
// Rinse and repeat the previous item, only specifying a different resource base.
|
||||
// Rinse and repeat the previous item, only specifying a different
|
||||
// resource base.
|
||||
ContextHandler context1 = new ContextHandler();
|
||||
context1.setContextPath("/");
|
||||
context1.setContextPath("/");
|
||||
ResourceHandler rh1 = new ResourceHandler();
|
||||
rh1.setBaseResource( Resource.newResource(MavenTestingUtils.getTestResourceDir("dir1")));
|
||||
File dir1 = MavenTestingUtils.getTestResourceDir("dir1");
|
||||
rh1.setBaseResource(Resource.newResource(dir1));
|
||||
context1.setHandler(rh1);
|
||||
|
||||
// Create a ContextHandlerCollection and set the context handlers to it. This will let jetty process urls
|
||||
// against the declared contexts in order to match up content.
|
||||
// Create a ContextHandlerCollection and set the context handlers to it.
|
||||
// This will let jetty process urls against the declared contexts in
|
||||
// order to match up content.
|
||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||
contexts.setHandlers(new Handler[]
|
||||
{ context0, context1 });
|
||||
contexts.setHandlers(new Handler[] { context0, context1 });
|
||||
|
||||
server.setHandler(contexts);
|
||||
|
||||
// Start things up! By using the server.join() the server thread will join with the current thread.
|
||||
// See "http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()" for more details.
|
||||
// Start things up!
|
||||
server.start();
|
||||
System.err.println(server.dump());
|
||||
|
||||
// Dump the server state
|
||||
System.out.println(server.dump());
|
||||
|
||||
// The use of server.join() the will make the current thread join and
|
||||
// wait until the server is done executing.
|
||||
// See http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#join()
|
||||
server.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -39,22 +39,24 @@ public class WebSocketJsrServer
|
|||
public static class EchoJsrSocket
|
||||
{
|
||||
@OnMessage
|
||||
public void onMessage(Session session, String message)
|
||||
public void onMessage( Session session, String message )
|
||||
{
|
||||
session.getAsyncRemote().sendText(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||
ServletContextHandler context = new ServletContextHandler(
|
||||
ServletContextHandler.SESSIONS);
|
||||
context.setContextPath("/");
|
||||
server.setHandler(context);
|
||||
|
||||
// Enable javax.websocket configuration for the context
|
||||
ServerContainer wsContainer = WebSocketServerContainerInitializer.configureContext(context);
|
||||
ServerContainer wsContainer = WebSocketServerContainerInitializer
|
||||
.configureContext(context);
|
||||
|
||||
// Add your websockets to the container
|
||||
wsContainer.addEndpoint(EchoJsrSocket.class);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
|
@ -41,7 +41,7 @@ public class WebSocketServer
|
|||
public static class EchoSocket
|
||||
{
|
||||
@OnWebSocketMessage
|
||||
public void onMessage(Session session, String message)
|
||||
public void onMessage( Session session, String message )
|
||||
{
|
||||
session.getRemote().sendStringByFuture(message);
|
||||
}
|
||||
|
@ -54,23 +54,24 @@ public class WebSocketServer
|
|||
public static class EchoServlet extends WebSocketServlet
|
||||
{
|
||||
@Override
|
||||
public void configure(WebSocketServletFactory factory)
|
||||
public void configure( WebSocketServletFactory factory )
|
||||
{
|
||||
// Register the echo websocket with the basic WebSocketCreator
|
||||
factory.register(EchoSocket.class);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
Server server = new Server(8080);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||
ServletContextHandler context = new ServletContextHandler(
|
||||
ServletContextHandler.SESSIONS);
|
||||
context.setContextPath("/");
|
||||
server.setHandler(context);
|
||||
|
||||
// Add the echo socket servlet to the /echo path map
|
||||
context.addServlet(new ServletHolder(EchoServlet.class),"/echo");
|
||||
context.addServlet(new ServletHolder(EchoServlet.class), "/echo");
|
||||
|
||||
server.start();
|
||||
context.dumpStdErr();
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<style>
|
||||
img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
td {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
tr {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 0 solid black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="pushtiles">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="tiles/tile00.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile01.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile02.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile03.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile04.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile05.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile06.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile07.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile08.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile09.jpg" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="tiles/tile10.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile11.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile12.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile13.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile14.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile15.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile16.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile17.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile18.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile19.jpg" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="tiles/tile20.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile21.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile22.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile23.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile24.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile25.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile26.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile27.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile28.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile29.jpg" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="tiles/tile30.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile31.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile32.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile33.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile34.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile35.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile36.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile37.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile38.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile39.jpg" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="tiles/tile40.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile41.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile42.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile43.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile44.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile45.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile46.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile47.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile48.jpg" alt="" /></td>
|
||||
<td><img src="tiles/tile49.jpg" alt="" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |