Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 896b8a5

Browse files
Adam LindenthalMarek Potociar
authored andcommitted
JERSEY-1912, JERSEY-2170 - Runtime/deployment documentation update.
- review changes incorporated. Change-Id: Iac7c02e028e355cc3f22b892d311a694af1220f3 Signed-off-by: Marek Potociar <[email protected]>
1 parent 307ffda commit 896b8a5

File tree

10 files changed

+1606
-212
lines changed

10 files changed

+1606
-212
lines changed

docs/src/main/docbook/deployment.xml

Lines changed: 1100 additions & 210 deletions
Large diffs are not rendered by default.

docs/src/main/docbook/getting-started.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
398398
<para>
399399
In the sections above, we have covered an approach how to get dirty with Jersey quickly. Please consult the other
400400
sections of the Jersey User Guide to learn more about Jersey and JAX-RS.
401-
Even though we try our best to cover as much as possibly in the User Guide, there is always a chance that you would
401+
Even though we try our best to cover as much as possible in the User Guide, there is always a chance that you would
402402
not be able to get a full answer to the problem you are solving. In that case, consider diving in our examples that
403403
provide additional tips and hints to the features you may want to use in your projects.
404404
</para>

docs/src/main/docbook/jersey.ent

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@
6363
<!ENTITY jee6.javadoc.path "http://docs.oracle.com/javaee/6/api">
6464
<!ENTITY jdk6.javadoc.path "http://docs.oracle.com/javase/6/docs/api">
6565
<!ENTITY jdk7.javadoc.path "http://docs.oracle.com/javase/7/docs/api">
66+
<!ENTITY jdk6.javadoc.httpserver "http://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec">
67+
<!ENTITY jsr.path "http://jcp.org/en/jsr/detail?id=">
68+
<!ENTITY maven.java.net.releases.link "https://maven.java.net/content/repositories/releases/">
6669

6770
<!ENTITY hk2.javadoc.path "https://hk2.java.net/apidocs">
6871

6972
<!ENTITY wadl.project.link "<link xlink:href='http://wadl.java.net/'>WADL</link>">
7073
<!ENTITY sse.spec.link "<link xlink:href='http://www.w3.org/TR/2009/WD-eventsource-20091029/'>SSE API specification</link>">
7174
<!ENTITY grizzly.link "<link xlink:href='http://grizzly.java.net/'>Grizzly</link>">
75+
<!ENTITY simple.link "<link xlink:href='http://www.simpleframework.org/'>Simple</link>">
7276
<!ENTITY hk2.link "<link xlink:href='http://hk2.java.net/'>HK2</link>">
7377
<!ENTITY maven.link "<link xlink:href='http://maven.apache.org/'>Apache Maven</link>">
7478
<!ENTITY maven.central.repo.link "<link xlink:href='http://search.maven.org/'>Central Maven Repository</link>">
@@ -86,8 +90,15 @@
8690
<!ENTITY bv11.javadoc.path "http://docs.jboss.org/hibernate/beanvalidation/spec/1.1/api">
8791

8892
<!ENTITY wikipedia.path "http://en.wikipedia.org/wiki">
93+
<!ENTITY osgi.wiki.path "http://wiki.osgi.org/wiki">
94+
<!ENTITY osgi.path "<link xlink:href='http://www.osgi.org/Download/Release4V42'>here</link>">
95+
<!ENTITY felix.path "<link xlink:href='http://felix.apache.org/site/index.html'>Apache Felix</link>">
96+
<!ENTITY pax.path "<link xlink:href='http://ops4j1.jira.com/wiki/display/PAXEXAM3/Pax+Exam'>PAX Exam</link>">
8997

90-
98+
<!ENTITY jsr311.path "<link xlink:href='&jsr.path;311'>JSR 311</link>">
99+
<!ENTITY jsr315.path "<link xlink:href='&jsr.path;315'>JSR 315</link>">
100+
<!ENTITY weblogic.guide "<link xlink:href='http://docs.oracle.com/middleware/1212/wls/RESTF/version-restful-service.htm'>guide</link>">
101+
<!ENTITY cloud.guide "<link xlink:href='http://docs.oracle.com/cloud/131/developer_services/CSJSU/java-develop.htm#BABHDAJH'>guide</link>">
91102

92103
<!-- Common Literals -->
93104
<!ENTITY lit.null "<literal>null</literal>">
@@ -123,6 +134,8 @@
123134
<!ENTITY jdk6.ParameterizedType "<link xlink:href='&jdk6.javadoc.path;/java/lang/reflect/ParameterizedType.html'>ParameterizedType</link>">
124135
<!ENTITY jdk6.DynamicMBean "<link xlink:href='&jdk6.javadoc.path;/javax/management/DynamicMBean.html'>DynamicMBean</link>">
125136
<!ENTITY jdk6.ObjectName "<link xlink:href='&jdk6.javadoc.path;/javax/management/ObjectName.html'>ObjectName</link>">
137+
<!ENTITY jdk6.HttpServer "<link xlink:href='&jdk6.javadoc.httpserver;/com/sun/net/httpserver/HttpServer.html'>HttpServer</link>">
138+
<!ENTITY jdk6.NIO "<link xlink:href='&jdk6.javadoc.path;/java/nio/package-summary.html'>NIO</link>">
126139

127140
<!ENTITY jdk7.org.w3c.dom.Document "<link xlink:href='&jdk7.javadoc.path;/org/w3c/dom/Document.html'>Document</link>">
128141
<!ENTITY jdk7.StreamSource "<link xlink:href='&jdk7.javadoc.path;/javax/xml/transform/stream/StreamSource.html'>StreamSource</link>">
@@ -258,6 +271,7 @@
258271
<!ENTITY jersey.apache.ApacheConnector "<link xlink:href='&jersey.javadoc.path;/apache/connector/ApacheConnector.html'>ApacheConnector</link>">
259272
<!ENTITY jersey.grizzly.GrizzlyConnector "<link xlink:href='&jersey.javadoc.path;/grizzly/connector/GrizzlyConnector.html'>GrizzlyConnector</link>">
260273
<!ENTITY jersey.jetty.JettyConnector "<link xlink:href='&jersey.javadoc.path;/jetty/connector/JettyConnector.html'>JettyConnector</link>">
274+
<!ENTITY jersey.grizzly.JdkHttpServerFactory "<link xlink:href='&jersey.javadoc.path;/jdkhttp/JdkHttpServerFactory.html'>JdkHttpServerFactory</link>">
261275
<!ENTITY jersey.client.HttpUrlConnector "<link xlink:href='&jersey.javadoc.path;/client/HttpUrlConnector.html'>HttpUrlConnector</link>">
262276
<!ENTITY jersey.client.ClientConfig "<link xlink:href='&jersey.javadoc.path;/client/ClientConfig.html'>ClientConfig</link>">
263277
<!ENTITY jersey.client.ClientProperties "<link xlink:href='&jersey.javadoc.path;/client/ClientProperties.html'>ClientProperties</link>">
@@ -298,6 +312,7 @@
298312
<!ENTITY jersey.sse.OutboundEventWriter "<link xlink:href='&jersey.javadoc.path;/media/sse/OutboundEventWriter.html'>OutboundEventWriter</link>">
299313
<!ENTITY jersey.sse.SseBroadcaster "<link xlink:href='&jersey.javadoc.path;/media/sse/SseBroadcaster.html'>SseBroadcaster</link>">
300314
<!ENTITY jersey.sse.SseFeature "<link xlink:href='&jersey.javadoc.path;/media/sse/SseFeature.html'>SseFeature</link>">
315+
<!ENTITY jersey.containers.ServletContainer "<link xlink:href='&jersey.javadoc.path;/servlet/ServletContainer.html'>ServletContainer</link>">
301316

302317
<!ENTITY jersey.common.Beta "<link xlink:href='&jersey.javadoc.path;/Beta.html'>Beta</link>">
303318
<!ENTITY jersey.common.CommonProperties "<link xlink:href='&jersey.javadoc.path;/CommonProperties.html'>CommonProperties</link>">
@@ -415,6 +430,7 @@
415430
<!ENTITY jersey.server.monitoring.TimeWindowStatistics "<link xlink:href='&jersey.javadoc.path;/server/monitoring/TimeWindowStatistics.html'>TimeWindowStatistics</link>">
416431

417432
<!ENTITY jersey.server.spi.ComponentProvider "<link xlink:href='&jersey.javadoc.path;/server/spi/ComponentProvider.html'>ComponentProvider</link>">
433+
<!ENTITY jersey.server.spi.ContainerProvider "<link xlink:href='&jersey.javadoc.path;/server/spi/ContainerProvider.html'>ContainerProvider</link>">
418434

419435

420436
<!ENTITY jersey.client.oauth1.AccessToken "<link xlink:href='&jersey.javadoc.path;/client/oauth1/AccessToken.html'>AccessToken</link>">
@@ -466,6 +482,11 @@
466482
<!ENTITY jersey.github.spring.example.path "<link xlink:href='&jersey.github.examples.path;/helloworld-spring-webapp'>Spring DI example</link>">
467483
<!ENTITY jersey.github.oauth1.twitter.client "<link xlink:href='&jersey.github.examples.path;/oauth-client-twitter'>OAuth 1 Twitter Client example</link>">
468484
<!ENTITY jersey.github.oauth2.google.client "<link xlink:href='&jersey.github.examples.path;/oauth2-client-google-webapp'>OAuth 2 Google Client WebApp example</link>">
485+
<!ENTITY jersey.github.osgi.webapp "<link xlink:href='&jersey.github.examples.path;/osgi-helloworld-webapp'>WAB Example</link>">
486+
<!ENTITY jersey.github.osgi.httpservice "<link xlink:href='&jersey.github.examples.path;/osgi-http-service'>HTTP Service example</link>">
487+
488+
<!-- Jersey maven repo links -->
489+
<!ENTITY repo.osgi.httpservice.bundle "<link xlink:href='&maven.java.net.releases.link;org/glassfish/jersey/examples/osgi-http-service/bundle/&version;'>repository</link>">
469490

470491
<!-- JEE links -->
471492
<!ENTITY jee6.annotations.RolesAllowed "<link xlink:href='&jee6.javadoc.path;/javax/annotation/security/RolesAllowed.html'>@RolesAllowed</link>">
@@ -509,6 +530,8 @@
509530
<!ENTITY wiki.Multipart "<link xlink:href='&wikipedia.path;/MIME#Multipart_messages'>MIME multipart message</link>">
510531
<!ENTITY wiki.MultipartMixed "<link xlink:href='&wikipedia.path;/MIME#Mixed'>multipart/mixed</link>">
511532
<!ENTITY wiki.JavaMemoryModel "<link xlink:href='&wikipedia.path;/Java_Memory_Model'>Java Memory Model</link>">
533+
<!ENTITY localhost.example.osgi.http "<link xlink:href='http://localhost:8080/osgi/jersey-http-service/status'>http://localhost:8080/osgi/jersey-http-service/status</link>">
534+
<!ENTITY osgi.wiki.headers "<link xlink:href='&osgi.wiki.path;/Category:Manifest_Header'>OSGi WIKI</link>">
512535

513536
<!-- API Literals -->
514537
<!ENTITY lit.jaxrs.ApplicationPath "<literal>@ApplicationPath</literal>">
@@ -723,6 +746,7 @@
723746
<!ENTITY lit.jersey.server.monitoring.TimeWindowStatistics "<literal>TimeWindowStatistics</literal>">
724747

725748
<!ENTITY lit.jersey.server.spi.ComponentProvider "<literal>ComponentProvider</literal>">
749+
<!ENTITY lit.jersey.server.spi.ContainerProvider "<literal>ContainerProvider</literal>">
726750

727751
<!ENTITY lit.jersey.client.oauth1.AccessToken "<literal>AccessToken</literal>">
728752
<!ENTITY lit.jersey.client.oauth1.ConsumerCredentials "<literal>ConsumerCredentials</literal>">

examples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<module>system-properties-example</module>
110110
<module>webapp-example-parent</module>
111111
<module>xml-moxy</module>
112+
<module>servlet3-webapp</module>
112113
</modules>
113114

114115
<dependencyManagement>

examples/servlet3-webapp/pom.xml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5+
6+
Copyright (c) 2011-2013 Oracle and/or its affiliates. All rights reserved.
7+
8+
The contents of this file are subject to the terms of either the GNU
9+
General Public License Version 2 only ("GPL") or the Common Development
10+
and Distribution License("CDDL") (collectively, the "License"). You
11+
may not use this file except in compliance with the License. You can
12+
obtain a copy of the License at
13+
http://glassfish.java.net/public/CDDL+GPL_1_1.html
14+
or packager/legal/LICENSE.txt. See the License for the specific
15+
language governing permissions and limitations under the License.
16+
17+
When distributing the software, include this License Header Notice in each
18+
file and include the License file at packager/legal/LICENSE.txt.
19+
20+
GPL Classpath Exception:
21+
Oracle designates this particular file as subject to the "Classpath"
22+
exception as provided by Oracle in the GPL Version 2 section of the License
23+
file that accompanied this code.
24+
25+
Modifications:
26+
If applicable, add the following below the License Header, with the fields
27+
enclosed by brackets [] replaced by your own identifying information:
28+
"Portions Copyright [year] [name of copyright owner]"
29+
30+
Contributor(s):
31+
If you wish your version of this file to be governed by only the CDDL or
32+
only the GPL Version 2, indicate your decision by adding "[Contributor]
33+
elects to include this software in this distribution under the [CDDL or GPL
34+
Version 2] license." If you don't indicate a single choice of license, a
35+
recipient has the option to distribute your version of this file under
36+
either the CDDL, the GPL Version 2 or to extend the choice of license to
37+
its licensees as provided above. However, if you add GPL Version 2 code
38+
and therefore, elected the GPL Version 2 license, then the option applies
39+
only if the new code is made subject to such option by the copyright
40+
holder.
41+
42+
-->
43+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
45+
46+
<modelVersion>4.0.0</modelVersion>
47+
48+
<parent>
49+
<groupId>org.glassfish.jersey.examples</groupId>
50+
<artifactId>webapp-example-parent</artifactId>
51+
<relativePath>../webapp-example-parent/pom.xml</relativePath>
52+
<version>2.5-SNAPSHOT</version>
53+
</parent>
54+
55+
<artifactId>servlet3-webapp</artifactId>
56+
<packaging>war</packaging>
57+
<name>jersey-examples-servlet3-webapp</name>
58+
59+
<description>Jersey Servlet 3 example with missing servlet-class in the web.xml file</description>
60+
61+
<dependencies>
62+
<dependency>
63+
<groupId>javax.servlet</groupId>
64+
<artifactId>javax.servlet-api</artifactId>
65+
<version>${servlet3.version}</version>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.glassfish.jersey.containers</groupId>
70+
<artifactId>jersey-container-grizzly2-servlet</artifactId>
71+
</dependency>
72+
</dependencies>
73+
74+
<build>
75+
<plugins>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-compiler-plugin</artifactId>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-surefire-plugin</artifactId>
83+
<configuration>
84+
<skipTests>true</skipTests>
85+
</configuration>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-failsafe-plugin</artifactId>
90+
</plugin>
91+
<plugin>
92+
<groupId>org.mortbay.jetty</groupId>
93+
<artifactId>jetty-maven-plugin</artifactId>
94+
<configuration>
95+
<skip>${skip.tests}</skip>
96+
<scanIntervalSeconds>10</scanIntervalSeconds>
97+
<stopPort>9999</stopPort>
98+
<stopKey>STOP</stopKey>
99+
<webApp>
100+
<contextPath>/</contextPath>
101+
<webInfIncludeJarPattern>.*/.*jersey-[^/]\.jar$</webInfIncludeJarPattern>
102+
</webApp>
103+
<connectors>
104+
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
105+
<port>${jersey.config.test.container.port}</port>
106+
<maxIdleTime>60000</maxIdleTime>
107+
</connector>
108+
</connectors>
109+
</configuration>
110+
<executions>
111+
<execution>
112+
<id>start-jetty</id>
113+
<phase>pre-integration-test</phase>
114+
<goals>
115+
<goal>run</goal>
116+
</goals>
117+
<configuration>
118+
<scanIntervalSeconds>0</scanIntervalSeconds>
119+
<daemon>true</daemon>
120+
</configuration>
121+
</execution>
122+
<execution>
123+
<id>stop-jetty</id>
124+
<phase>post-integration-test</phase>
125+
<goals>
126+
<goal>stop</goal>
127+
</goals>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
</plugins>
132+
</build>
133+
134+
<profiles>
135+
<profile>
136+
<id>default</id>
137+
<properties>
138+
<env>default</env>
139+
<jersey.config.test.container.port>9998</jersey.config.test.container.port>
140+
</properties>
141+
<activation>
142+
<activeByDefault>true</activeByDefault>
143+
</activation>
144+
</profile>
145+
146+
<profile>
147+
<id>release</id>
148+
<build>
149+
<plugins>
150+
<plugin>
151+
<groupId>org.codehaus.mojo</groupId>
152+
<artifactId>xml-maven-plugin</artifactId>
153+
</plugin>
154+
<plugin>
155+
<groupId>org.apache.maven.plugins</groupId>
156+
<artifactId>maven-assembly-plugin</artifactId>
157+
</plugin>
158+
</plugins>
159+
</build>
160+
</profile>
161+
</profiles>
162+
163+
</project>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
package org.glassfish.jersey.examples.servlet3.webapp;
41+
42+
import javax.ws.rs.ApplicationPath;
43+
import javax.ws.rs.core.Application;
44+
import java.util.HashSet;
45+
import java.util.Set;
46+
47+
/**
48+
* Test Application subclass for servlet3-webapp example.
49+
*
50+
* @author Adam Lindenthal (adam.lindenthal at oracle.com)
51+
*/
52+
public class App extends Application {
53+
@Override
54+
public Set<Class<?>> getClasses() {
55+
HashSet<Class<?>> classes = new HashSet<Class<?>>();
56+
classes.add(DogResource.class);
57+
classes.add(CatResource.class);
58+
return classes;
59+
}
60+
61+
}

0 commit comments

Comments
 (0)