This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new c4f1346 Javadocs.
c4f1346 is described below
commit c4f1346a7c82fa6af07b5f9f3a4d83e1b898c98c
Author: JamesBognar <[email protected]>
AuthorDate: Tue Dec 11 15:51:51 2018 -0500
Javadocs.
---
.../juneau-microservice-server.Installing.1.png | Bin 156973 -> 0 bytes
.../juneau-microservice-server.Installing.2.png | Bin 78192 -> 0 bytes
.../03.ResourceClasses.html | 4 +-
.../07.UiCustomization.html | 2 +-
...uneau-microservice-jetty.ResourceClasses.1.png} | Bin
.../juneau-microservice-jetty.Running.1.png} | Bin
...uneau-microservice-jetty.UiCustomization.1.png} | Bin
.../juneau-microservice-server.Installing.1.png | Bin 156973 -> 0 bytes
.../juneau-microservice-server.Installing.2.png | Bin 78192 -> 0 bytes
.../13.juneau-microservice-jetty-template.html | 20 +-
.../01.Introduction.html | 21 +-
.../02.GettingStarted.html | 4 +-
.../02.GettingStarted/01.Installing.html | 72 ++-
.../02.GettingStarted/02.Running.html | 4 +-
.../02.GettingStarted/03.Building.html | 3 +-
.../03.Manifest.html | 37 --
.../03.Manifest/01.ManifestApi.html | 30 -
.../04.Config.html | 25 -
.../04.Config/01.ConfigApi.html | 129 -----
.../05.ResourceClasses.html | 85 ---
.../06.PredefinedResourceClasses.html | 32 --
.../07.RestMicroservice.html | 40 --
.../07.RestMicroservice/01.Extending.html | 64 ---
.../08.UiCustomization.html | 126 ----
...u-microservice-jetty-template.Installing.1.png} | Bin
...au-microservice-jetty-template.Installing.2.png | Bin 0 -> 103957 bytes
...roservice-jetty-template.ResourceClasses.1.png} | Bin
...neau-microservice-jetty-template.Running.1.png} | Bin
...roservice-jetty-template.UiCustomization.1.png} | Bin
.../juneau-microservice-server.Installing.2.png | Bin 78192 -> 0 bytes
.../14.juneau-examples-core/01.Examples.html | 6 +-
.../Topics/17.juneau-examples-rest-springboot.html | 2 +-
...u-microservice-jetty-template.Installing.1.png} | Bin
...au-microservice-jetty-template.Installing.2.png | Bin 0 -> 103957 bytes
...roservice-jetty-template.ResourceClasses.1.png} | Bin
...neau-microservice-jetty-template.Running.1.png} | Bin
...roservice-jetty-template.UiCustomization.1.png} | Bin
...uneau-microservice-jetty.ResourceClasses.1.png} | Bin
.../juneau-microservice-jetty.Running.1.png} | Bin
...uneau-microservice-jetty.UiCustomization.1.png} | Bin
.../juneau-microservice-server.Installing.2.png | Bin 78192 -> 0 bytes
juneau-doc/src/main/javadoc/overview.html | 632 +++------------------
juneau-doc/src/main/javadoc/resources/docs.txt | 9 -
.../src/main/javadoc/resources/fragments/toc.html | 27 +-
.../org/apache/juneau/examples/rest/jetty/App.java | 1 -
.../main/resources}/files/htdocs/images/asf.png | Bin
.../main/resources}/files/htdocs/images/juneau.png | Bin
.../resources}/files/htdocs/styles/SwaggerUI.css | 0
.../main/resources}/files/htdocs/themes/dark.css | 0
.../main/resources}/files/htdocs/themes/devops.css | 0
.../main/resources}/files/htdocs/themes/light.css | 0
.../resources}/files/htdocs/themes/original.css | 0
.../src/main/resources}/jetty.xml | 0
.../juneau-microservice-jetty-template/.classpath | 3 +-
.../build-overlay/.classpath | 3 +-
.../build-overlay/my-microservice.launch | 3 +-
.../build-overlay/pom.xml | 13 +-
.../my-microservice.cfg | 11 +-
.../my-microservice.launch | 9 +-
.../juneau-microservice-jetty-template/pom.xml | 2 +-
.../src/assembly/bin.xml | 4 -
.../apache/juneau/microservice/sample}/App.java | 12 +-
.../juneau/microservice/sample/RootResources.java | 2 +-
.../main/resources}/files/htdocs/images/asf.png | Bin
.../main/resources}/files/htdocs/images/juneau.png | Bin
.../resources}/files/htdocs/styles/SwaggerUI.css | 0
.../main/resources}/files/htdocs/themes/dark.css | 0
.../main/resources}/files/htdocs/themes/devops.css | 0
.../main/resources}/files/htdocs/themes/light.css | 0
.../resources}/files/htdocs/themes/original.css | 0
.../src/main/resources}/jetty.xml | 5 +
71 files changed, 175 insertions(+), 1267 deletions(-)
diff --git
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.1.png
b/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.1.png
deleted file mode 100755
index 4ea5cec..0000000
Binary files
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.1.png
and /dev/null differ
diff --git
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.2.png
b/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.2.png
deleted file mode 100755
index 9caeff9..0000000
Binary files
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Installing.2.png
and /dev/null differ
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/03.ResourceClasses.html
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/03.ResourceClasses.html
index 1b7a6f7..0286677 100644
---
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/03.ResourceClasses.html
+++
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/03.ResourceClasses.html
@@ -45,7 +45,7 @@
<p class='bpcode w800'>
http://localhost:10000
</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.Running.1.png'>
+<img class='bordered w800'
src='doc-files/juneau-microservice-jetty.Running.1.png'>
<ul class='spaced-list'>
<li>
The </l>title</l> and <l>description</l> annotations define the
titles on the page.
@@ -66,7 +66,7 @@
<p class='bpcode w800'>
http://localhost:10000/helloWorld
</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.ResourceClasses.1.png'>
+<img class='bordered w800'
src='doc-files/juneau-microservice-jetty.ResourceClasses.1.png'>
<p>
...which is generated by this class...
</p>
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/07.UiCustomization.html
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/07.UiCustomization.html
index acf5ba4..e2e3692 100644
---
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/07.UiCustomization.html
+++
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/07.UiCustomization.html
@@ -19,7 +19,7 @@
The Microservice project contains a <code>files/htdocs</code> folder
with predefined stylesheets and
images.
</p>
-<img style='width:200px'
src='doc-files/juneau-microservice.UiCustomization.1.png'>
+<img style='width:200px'
src='doc-files/juneau-microservice-jetty.UiCustomization.1.png'>
<p>
These files can be used to tailor the look-and-feel of your
microservice.
</p>
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.ResourceClasses.1.png
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.ResourceClasses.1.png
similarity index 100%
rename from
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.ResourceClasses.1.png
rename to
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.ResourceClasses.1.png
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Running.1.png
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.Running.1.png
similarity index 100%
rename from
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Running.1.png
rename to
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.Running.1.png
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice.UiCustomization.1.png
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.UiCustomization.1.png
similarity index 100%
rename from
juneau-doc/src/main/javadoc/doc-files/juneau-microservice.UiCustomization.1.png
rename to
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-jetty.UiCustomization.1.png
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.1.png
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.1.png
deleted file mode 100755
index 4ea5cec..0000000
Binary files
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.1.png
and /dev/null differ
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.2.png
b/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.2.png
deleted file mode 100755
index 9caeff9..0000000
Binary files
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Installing.2.png
and /dev/null differ
diff --git a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template.html
index 98e5ee3..5035644 100644
--- a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template.html
+++ b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template.html
@@ -13,33 +13,23 @@
***************************************************************************************************************************/
-->
-{todo} juneau-microservice-jetty-template
+{new} juneau-microservice-jetty-template
<h5 class='figure'>Maven Dependency</h5>
<p class='bpcode w500'>
<xt><dependency></xt>
<xt><groupId></xt>org.apache.juneau<xt></groupId></xt>
-
<xt><artifactId></xt>juneau-microservice-server<xt></artifactId></xt>
+
<xt><artifactId></xt>juneau-microservice-jetty-template<xt></artifactId></xt>
<xt><version></xt>{@property
juneauVersion}<xt></version></xt>
<xt></dependency></xt>
</p>
-<h5 class='figure'>Java Library</h5>
-<p class='bpcode w500'>
- juneau-microservice-server-{@property juneauVersion}.jar
-</p>
-
-<h5 class='figure'>OSGi Module</h5>
-<p class='bpcode w500'>
- org.apache.juneau.microservice.jetty.server_{@property
juneauVersion}.jar
-</p>
-
<h5 class='figure'>Microservice Starter Project</h5>
<p class='bpcode w500'>
- my-microservice.zip
+ my-microservice-jetty-{@property juneauVersion}.zip
</p>
<p>
- Juneau Microservice is an API for creating stand-alone executable jars
that can be used to
- start lightweight configurable REST interfaces with all the power of
the Juneau REST server and client APIs.
+ The <l>my-microservice-jetty.zip</l> file is a predefined starter
Eclipse project for developing
+ REST microservices using the {@doc juneau-microservice-jetty} package.
</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/01.Introduction.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/01.Introduction.html
index 1f572ff..86c161e 100644
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/01.Introduction.html
+++
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/01.Introduction.html
@@ -13,12 +13,12 @@
***************************************************************************************************************************/
-->
-{todo} Microservice Introduction
+{updated} Microservice Introduction
<p>
The Microservice API consists of a combination of the Juneau Core,
Server, and Client APIs and an embedded
Eclipse Jetty Servlet Container.
- <br>It includes all libraries needed to execute in a Java 1.7+
environment.
+ <br>It includes all libraries needed to execute in a Java 1.8+
environment.
</p>
<p>
Features include:
@@ -27,7 +27,7 @@
<li>
An out-of-the-box zipped Eclipse project to get started quickly.
<li>
- Packaged as a simple executable jar and configuration file.
+ Buildable as a simple executable jar and configuration file.
<li>
All the power of the Juneau ecosystem for defining REST
servlets and clients with the ability to
serialize and parse POJOs as HTML, JSON, XML, RDF,
URL-Encoding, and others.
@@ -39,18 +39,3 @@
<li>
Predefined REST resources for configuring microservice and
accessing log files.
</ul>
-<p>
- The <code>juneau-microservice-server</code> library consists of the
following classes:
-</p>
-<ul class='doctree'>
- <li class='jac'>
- {@link oaj.microservice.Microservice}
- - Defines basic lifecycle methods for microservices in general.
- <ul>
- <li class='jc'>
- {@link oaj.microservice.RestMicroservice}
- - Defines additional lifecycle methods for REST
microservices.
- <br>Starts up an externally-configured Jetty
server, registers servlets, and sets up
- other features such as logging.
- </ul>
-</ul>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted.html
index b09fffe..eb3ea78 100644
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted.html
+++
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted.html
@@ -13,9 +13,9 @@
***************************************************************************************************************************/
-->
-{todo} Getting Started
+{updated} Getting Started
<p>
- The <l>my-microservice.zip</l> file is a zipped eclipse project that
includes everything you
+ The <l>my-microservice-jetty.zip</l> file is a zipped eclipse project
that includes everything you
need to create a REST microservice in an Eclipse workspace.
</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/01.Installing.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/01.Installing.html
index ab7bdb2..40b6611 100644
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/01.Installing.html
+++
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/01.Installing.html
@@ -13,29 +13,48 @@
***************************************************************************************************************************/
-->
-Installing in Eclipse
+{updated} Installing in Eclipse
<p>
Follow these instructions to create a new template project in Eclipse.
</p>
<ol class='spaced-list'>
<li>
- Download the latest microservice-project zip file (e.g.
<l>my-microservice.zip</l>).
+ Download the latest <l>my-jetty-microservice.zip</l> file.
<li>
In your Eclipse workspace, go to <b>File -> Import ->
General -> Existing Projects into Workspace</b>
and select the zip file and click <b>Finish</b>.
<br><br>
- <img class='bordered'
src='doc-files/juneau-microservice-server.Installing.1.png' style='width:549px'>
+ <img class='bordered'
src='doc-files/juneau-microservice-jetty-template.Installing.1.png'
style='width:549px'>
<li>
In your workspace, you should now see the following project:
<br><br>
- <img class='bordered'
src='doc-files/juneau-microservice-server.Installing.2.png' style='width:299px'>
+ <img class='bordered'
src='doc-files/juneau-microservice-jetty-template.Installing.2.png'
style='width:400px'>
</ol>
<p>
The important elements in this project are:
</p>
<ul class='spaced-list'>
<li>
+ <l>App.java</l> - The entry point.
+ <br>This class creates and starts our microservice:
+ <br><br>
+ <p class='bcode w800'>
+ <jk>public class</jk> App {
+
+ <jk>public static void</jk> main(String[] args) <jk>throws</jk>
Exception {
+ JettyMicroservice
+ .<jsm>create</jsm>()
+ .args(args)
+ .servlet(RootResources.<jk>class</jk>)
+ .build()
+ .start()
+ .startConsole()
+ .join();
+ }
+ }
+ </p>
+ <li>
<l>RootResources.java</l> - The top-level REST resource.
<br>This class routes HTTP requests to child resources:
<br><br>
@@ -74,13 +93,6 @@ Installing in Eclipse
# Subprojects can use this as a starting point.
#=======================================================================================================================</cc>
- <cc># What to do when the config file is saved.
- # Possible values:
- # NOTHING - Don't do anything. (default)
- # RESTART_SERVER - Restart the Jetty server.
- # RESTART_SERVICE - Shutdown and exit with code '3'.</cc>
- <ck>saveConfigAction</ck> = <cv>RESTART_SERVER</cv>
-
<cc>#=======================================================================================================================
# Jetty settings
#=======================================================================================================================</cc>
@@ -98,17 +110,34 @@ Installing in Eclipse
# jetty.xml file as "$S{availablePort}" (assuming resolveVars is
enabled).</cc>
<ck>port</ck> = <cv>10000,0,0,0</cv>
+ <cc># Optionally specify your servlets here:
+ #servlets = org.apache.juneau.microservice.sample.RootResources</cc>
+
<cc>#=======================================================================================================================
# REST settings
#=======================================================================================================================</cc>
<cs>[REST]</cs>
- <cc># Stylesheet to use for HTML views.
- # The default options are:
- # - servlet:/styles/juneau.css
- # - servlet:/styles/devops.css
- # Other stylesheets can be referenced relative to the servlet package
or working directory.</cc>
- <ck>stylesheet</ck> = <cv>servlet:/styles/devops.css</cv>
+ <cc># URL mappings to static files in the working directory or
classpath.</cc>
+ <ck>staticFiles</ck> = htdocs:files/htdocs
+
+ <cc># Stylesheet to use for HTML views.</cc>
+ <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv>
+
+ <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv>
+ <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv>
+ <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv>
+ <ck>footerLink</ck> = <cv>http://www.apache.org</cv>
+
+ <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv>
+ <ck>header</ck> =
+ <cv><a href='$U{$C{REST/headerLink}}'>
+ <img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>
+ </a></cv>
+ <ck>footer</ck> =
+ <cv><a href='$U{$C{REST/footerLink}}'>
+ <img src='$U{$C{REST/footerIcon}}'
style='float:right;padding-right:20px;height:32px'/>
+ </a></cv>
<cc>#=======================================================================================================================
# Console settings
@@ -177,10 +206,11 @@ Installing in Eclipse
<xt><New</xt> <xa>id</xa>=<xs>"context"</xs>
<xa>class</xa>=<xs>"org.eclipse.jetty.servlet.ServletContextHandler"</xs><xt>></xt>
<xt><Set</xt>
<xa>name</xa>=<xs>"contextPath"</xs><xt>>/</Set></xt>
- <xt><Call</xt>
<xa>name</xa>=<xs>"addServlet"</xs><xt>></xt>
-
<xt><Arg></xt>org.apache.juneau.microservice.sample.RootResources<xt></Arg></xt>
- <xt><Arg></xt>/*<xt></Arg></xt>
- <xt></Call></xt>
+ <xc><!-- Optionally specify your servlets here -->
+ <!--Call name="addServlet">
+
<Arg>org.apache.juneau.microservice.sample.RootResources</Arg>
+ <Arg>/*</Arg>
+ </Call--></xc>
<xt><Set</xt>
<xa>name</xa>=<xs>"sessionHandler"</xs><xt>></xt>
<xt><New</xt>
<xa>class</xa>=<xs>"org.eclipse.jetty.server.session.SessionHandler"</xs><xt>/></xt>
<xt></Set></xt>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/02.Running.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/02.Running.html
index 07a5cc3..9a28e76 100644
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/02.Running.html
+++
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/02.Running.html
@@ -13,7 +13,7 @@
***************************************************************************************************************************/
-->
-Running in Eclipse
+{updated} Running in Eclipse
<p>
The <l>my-microservice.launch</l> file is already provided to allow you
to quickly start
@@ -41,7 +41,7 @@ Running in Eclipse
<p class='bpcode w400'>
http://localhost:10000
</p>
-<img class='bordered w400'
src='doc-files/juneau-microservice-server.Running.1.png'>
+<img class='bordered w400'
src='doc-files/juneau-microservice-jetty-template.Running.1.png'>
<p>
You have started a REST interface on port 10000.
<br>You can enter the command <code>exit</code> to shut it down.
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/03.Building.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/03.Building.html
index baad975..9da50fa 100644
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/03.Building.html
+++
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/02.GettingStarted/03.Building.html
@@ -13,7 +13,7 @@
***************************************************************************************************************************/
-->
-Building and Running from Command-Line
+{updated} Building and Running from Command-Line
<p>
The <l>pom.xml</l> file is a basic Maven build script for creating your
microservice
@@ -31,7 +31,6 @@ Building and Running from Command-Line
<ul>
<li><code>my-microservice-1.0.jar</code>
<li><code>my-microservice.cfg</code>
- <li><code>jetty.xml</code>
</ul>
<p>
To start from a command line, run the following command from inside
your <code>target</code> directory:
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest.html
deleted file mode 100644
index 3f2d849..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} Manifest File
-
-<p>
- The generated <l>META-INF/MANIFEST.MF</l> file is used to describe the
microservice.
- <br>If you open it, you'll see the following:
-</p>
-<p class='bpcode w800'>
- <mk>Main-Class</mk>:
<mv>org.apache.juneau.microservice.jetty.RestMicroservice</mv>
- <mk>Main-ConfigFile</mk>: <mv>my-microservice.cfg</mv>
-<p>
- The <mk>Main-Class</mk> entry is the standard manifest entry describing
the entry point for the executable jar.
- <br>In most cases, this value will always be
<l>org.apache.juneau.microservice.jetty.RestMicroservice</l>.
- <br>However, it is possible to extend this class or implement your own
microservice, in which case you'll need
- to modify this value to point to the new class.
-</p>
-<p>
- The <mk>Main-ConfigFile</mk> entry points to the location of an
external configuration file for our microservice.
-</p>
-<p>
- In addition to these predefined manifest entries, you can add your own
particular entries to the manifest file
- and access them through the Manifest API described next.
-</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest/01.ManifestApi.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest/01.ManifestApi.html
deleted file mode 100644
index 4eed31d..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/03.Manifest/01.ManifestApi.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-Manifest API
-
-<p>
- The {@link oaj.microservice.Microservice#getManifest()} method is a
static method that
- can be used to retrieve the manifest file as a {@link
oaj.utils.ManifestFile}.
-</p>
-<p class='bpcode w800'>
- <jc>// Get Main-Class from manifest file.</jc>
- String mainClass =
Microservice.<jsm>getInstance</jsm>().getManifest().getString(<js>"Main-Class"</js>,
<js>"unknown"</js>);
-</p>
-<p>
- The {@link oaj.utils.ManifestFile} class extends {@link oaj.ObjectMap},
- making it possible to retrieve entries as a wide variety of object
types such as java primitives, arrays, collections,
- maps, or even POJOs serialized as JSON.
-</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config.html
deleted file mode 100644
index 0c6f87c..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} Config
-
-<p>
- The microservice config file is an external INI-style configuration
file that is used to configure
- your microservice.
-</p>
-<h5 class='section'>See Also:</h5>
-<ul class='doctree'>
- <li class='link'>{@doc juneau-config}
-</ul>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config/01.ConfigApi.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config/01.ConfigApi.html
deleted file mode 100644
index 35499bd..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/04.Config/01.ConfigApi.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-Config File API
-
-<p>
- There are 3 primary ways of getting access to the config file.
-</p>
-<ul class='doctree'>
- <li class='jm'>{@link oaj.microservice.Microservice#getConfig()}
- <br>Any {@doc DefaultRestSvlVariables initialization-time
variables} can be used.
- <li class='jm'>{@link oajr.RestContext#getConfig()}
- <br>Any {@doc DefaultRestSvlVariables initialization-time
variables} can be used.
- <h5 class='figure'>Example usage:</h5>
- <p class='bcode w800'>
- <cc>#-------------------------------</cc>
- <cc># Properties for MyHelloResource </cc>
- <cc>#-------------------------------</cc>
- <cs>[MyHelloResource]</cs>
- <ck>greeting</ck> = <cv>Hello world!</cv>
- </p>
- <p class='bcode w800'>
- <ja>@RestResource</ja>(...)
- <jk>public class</jk> MyHelloResource <jk>extends</jk> BasicRestServlet
{
- <jc>// Access config file when initializing fields.</jc>
- <jk>private</jk> String greeting =
getConfig().getString(<js>"MyHelloResource/greeting"</js>);
-
- <jc>// Or access config file in servlet init method.</jc>
- <ja>@Override</ja> <jc>/* Servlet */</jc>
- <jk>public void</jk> init() {
- String greeting =
getConfig().getString(<js>"MyHelloResource/greeting"</js>);
- }
- }
- </p>
- <p>
- Additional user-defined variables can be defined at
this level by adding a
- {@link oajr.annotation.HookEvent#INIT} hook method
- and using the {@link
oajr.RestContextBuilder#vars(Class...)} method.
- </p>
- <li class='jm'>
- {@link oajr.RestRequest#getConfig()}
- - An instance method to access it from inside a REST method.
- <br>Any {@doc DefaultRestSvlVariables initialization-time or
request-time variables} can be used.
-
- <h5 class='figure'>Example usage:</h5>
- <p class='bcode w800'>
- <cc>#-----------------------------</cc>
- <cc># Contents of microservice.cfg </cc>
- <cc>#-----------------------------</cc>
- <cs>[MyHelloResource]</cs>
- <ck>greeting</ck> = <cv>Hello $RP{person}!</cv>
- <ck>localizedGreeting</ck> = <cv>$L{HelloMessage,$RP{person}}</cv>
- </p>
- <p class='bcode w800'>
- <cc>#---------------------------------</cc>
- <cc># Contents of MyHelloResource.java </cc>
- <cc>#---------------------------------</cc>
- <ja>@RestResource</ja>(
- path=<js>"/hello"</js>,
- messages=<js>"nls/Messages"</js>,
- ...
- )
- <jk>public class</jk> MyHelloResource <jk>extends</jk> BasicRestServlet
{
-
- <jd>/** Standard hello message. */</jd>
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>,
path=<js>"/{person}"</js>)
- <jk>public</jk> String sayHello(RestRequest req) {
- <jk>return</jk>
req.getConfig().getString(<js>"MyHelloResource/greeting"</js>);
- }
-
- <jd>/** Hello message in users language. */</jd>
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>,
path=<js>"/localized/{person}"</js>)
- <jk>public</jk> String sayLocalizedHello(RestRequest req) {
- <jk>return</jk>
req.getConfig().getString(<js>"MyHelloResource/localizedGreeting"</js>);
- }
- }
- </p>
- <p class='bcode w800'>
- <cc>#---------------------------------------</cc>
- <cc># Contents of nls/Messages_en.properties </cc>
- <cc>#---------------------------------------</cc>
- <ck>MyHelloResource.HelloMessage</ck> = <cv>Hello {0}!</cv>
- </p>
- <p>
- Additional user-defined variables can be defined at
this level by overriding the
- {@link oajr.RestContextBuilder#vars(Class...)} method.
- </p>
-</ul>
-<p>
- That <l>sayLocalizedHello()</l> example might need some explanation
since there's a lot going on there.
- <br>Here's what happens when an HTTP call is made to <l>GET
/hello/localized/Bob</l>:
-</p>
-<ol class='spaced-list'>
- <li>
- The HTTP call matches the <l>/hello</l> path on the
<l>MyHelloResource</l> class.
- <li>
- The HTTP call matches the <l>/localized/{person}</l> path on
the <l>sayLocalizedHello()</l> method.
- <li>
- The request attribute <l>person</l> gets assigned the value
<l>"Bob"</l>.
- <li>
- The call to
<l>req.getConfig().getString("MyHelloResource/localizedGreeting")</l>
- finds the value <l>"$L{HelloMessage,$RP{person}}"</l>.
- <li>
- The arguments in the <l>$L{}</l> variable get resolved,
resulting in <l>"$L{HelloMessage,Bob}"</l>.
- <li>
- The <l>$L{}</l> variable gets resolved to the message <l>"Hello
{0}!"</l> in the localized properties
- file of the servlet based on the <l>Accept-Language</l> header
on the request.
- <li>
- The arguments get replaced in the message resulting in
<l>"Hello Bob!"</l>.
- <li>
- The resulting message <l>"Hello Bob!"</l> is returned as a POJO
to be serialized to whatever content
- type was specified on the <l>Accept</l> header on the request.
-</ol>
-<p>
- This particular example is needlessly complex, but it gives an idea of
how variables can be used
- recursively to produce sophisticated results
-</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/05.ResourceClasses.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/05.ResourceClasses.html
deleted file mode 100644
index 2d2b548..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/05.ResourceClasses.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} Resource Classes
-
-<p>
- Now let's take a look at the resource classes themselves.
- <br>The top-level page...
-</p>
-<p class='bpcode w800'>
- http://localhost:10000
-</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.Running.1.png'>
-<p>
- ...is generated by this class...
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- path=<js>"/"</js>,
- title=<js>"My Microservice"</js>,
- description=<js>"Top-level resources page"</js>,
- htmldoc=<ja>@HtmlDoc</ja>(
- navlinks={
- <js>"options: servlet:/?method=OPTIONS"</js>
- }
- ),
- children={
- HelloWorldResource.<jk>class</jk>,
- ConfigResource.<jk>class</jk>,
- LogsResource.<jk>class</jk>
- }
- )
- <jk>public class</jk> RootResources <jk>extends</jk>
BasicRestServletJenaGroup {
- <jc>// No code! </jc>
- }
-</p>
-<ul class='spaced-list'>
- <li>
- The </l>title</l> and <l>description</l> annotations define the
titles on the page.
- <br>These can be globalized using <l>$L{...}</l> variables, or
by defining specially-named properties in the
- properties file for the resource.
- <li>
- In this case, the <l>path</l> annotation defines the context
root of your application since it was
- not specified in the manifest or config file.
- <br>Therefore, this resource is mapped to
<l>http://localhost:10000</l>.
- <li>
- The <l>children</l> annotation make up the list of child
resources.
- <br>These child resources can be anything that extends from
<l>Servlet</l>, although usually
- they will be subclasses of {@link oajr.BasicRestServlet} or
other resource groups.
-</ul>
-<p>
- If you click the <l>helloWorld</l> link in your application, you'll get
a simple hello world message:
-</p>
-<p class='bpcode w800'>
- http://localhost:10000/helloWorld
-</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.ResourceClasses.1.png'>
-<p>
- ...which is generated by this class...
-</p>
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- path=<js>"/helloWorld"</js>,
- title=<js>"Hello World example"</js>,
- description=<js>"Simplest possible REST resource"</js>
- )
- <jk>public class</jk> HelloWorldResource <jk>extends</jk>
BasicRestServlet {
-
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/*"</js>)
- <jk>public</jk> String sayHello() {
- <jk>return</jk> <js>"Hello world!"</js>;
- }
- }
-</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/06.PredefinedResourceClasses.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/06.PredefinedResourceClasses.html
deleted file mode 100644
index cd6dea2..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/06.PredefinedResourceClasses.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} Predefined Resource Classes
-
-<p>
- The following predefined resource classes are also provided for easy
inclusion into your microservice:
-</p>
-<ul class='doctree'>
- <li class='jc'>{@link oaj.microservice.resources.ConfigResource}
- - View and modify the external INI config file.
- <li class='jc'>{@link oaj.microservice.resources.DirectoryResource}
- - View and modify file system directories.
- <li class='jc'>{@link oaj.microservice.resources.LogsResource}
- - View and control generated log files.
- <li class='jc'>{@link oaj.microservice.resources.SampleRootResource}
- - A sample root resource class to get started from.
- <li class='jc'>{@link oaj.microservice.resources.ShutdownResource}
- - Shutdown and/or restart the JVM.
-</ul>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice.html
deleted file mode 100644
index cf04791..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} RestMicroservice
-
-<p>
- The {@link oaj.microservice.RestMicroservice} class is the main
application entry-point for REST
- microservices.
-</p>
-<p>
- The class hierarchy is:
-</p>
-<ul class='doctree'>
- <li class='jac'>
- {@link oaj.microservice.Microservice}
- - Abstract class that defines simple start/stop methods and
access to the manifest file, config file, and
- arguments.
- <ul>
- <li class='jc'>
- {@link oaj.microservice.RestMicroservice}
- - Specialized microservice for starting up REST
interfaces using Jetty and specifying REST servlets
- through the manifest file or config file.
- </ul>
- </li>
-</ul>
-<p>
- Refer to the Javadocs for these class for more information.
-</p>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice/01.Extending.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice/01.Extending.html
deleted file mode 100644
index 5ceef27..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/07.RestMicroservice/01.Extending.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-Extending RestMicroservice
-
-<p>
- This example shows how the {@link oaj.microservice.RestMicroservice}
class
- can be extended to implement lifecycle listener methods or override
existing methods.
- <br>We'll create a new class
<l>com.foo.SampleCustomRestMicroservice</l>.
-</p>
-<p>
- First, the manifest file needs to be modified to point to our new
microservice:
-</p>
-<p class='bpcode w800'>
- <mk>Main-Class:</mk> com.foo.SampleCustomRestMicroservice
-</p>
-<p>
- Then we define the following class:
-</p>
-<p class='bpcode w800'>
- <jd>/**
- * Sample subclass of a RestMicroservice that provides customized
behavior.
- * This class must be specified in the Main-Class entry in the manifest
file and optionally
- * a Main-ConfigFile entry.
- */</jd>
- <jk>public class</jk> SampleCustomRestMicroservice <jk>extends</jk>
RestMicroservice {
-
- <jd>/**
- * Must implement a main method and call start()!
- */</jd>
- <jk>public static void</jk> main(String[] args) <jk>throws</jk>
Exception {
- <jk>new</jk>
SampleCustomRestMicroservice(args).start().join();
- }
-
- <jd>/**
- * Must implement a constructor!
- *
- * <ja>@param</ja> args Command line arguments.
- * <ja>@throws</ja> Exception
- */</jd>
- <jk>public</jk> SampleCustomRestMicroservice(String[] args)
<jk>throws</jk> Exception {
- <jk>super</jk>(args);
- }
-</p>
-<p>
- The microservice APIs provide several useful methods that can be used
or extended.
-</p>
-<h5 class='section'>See Also:</h5>
-<ul class='doctree'>
- <li class='jac'>{@link oaj.microservice.Microservice}
- <li class='jc'>{@link oaj.microservice.RestMicroservice}
-</ul>
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/08.UiCustomization.html
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/08.UiCustomization.html
deleted file mode 100644
index f31d2be..0000000
---
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/08.UiCustomization.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<!--
-/***************************************************************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file
- * distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
- * specific language governing permissions and limitations under the License.
-
***************************************************************************************************************************/
- -->
-
-{todo} UI Customization
-
-<p>
- The Microservice project contains a <code>files/htdocs</code> working
directly folder with predefined stylesheets and
- images.
-</p>
-<img style='width:200px'
src='doc-files/juneau-microservice.UiCustomization.1.png'>
-<p>
- These files can be used to tailor the look-and-feel of your
microservice.
-</p>
-<p class='bpcode w800'>
- http://localhost:10000/helloWorld
-</p>
-<img class='bordered w800'
src='doc-files/juneau-rest-server.UiCustomization.1.png'>
-<p>
- The REST configuration section of your microservice configuration file
can be used to tailor the header and footer on the pages:
-</p>
-<p class='bpcode w800'>
-
<cc>#=======================================================================================================================
- # REST settings
-
#=======================================================================================================================</cc>
- <cs>[REST]</cs>
-
- <ck>staticFiles</ck> = <cv>htdocs:files/htdocs</cv>
-
- <cc># Stylesheet to use for HTML views.</cc>
- <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv>
-
- <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv>
- <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv>
- <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv>
- <ck>footerLink</ck> = <cv>http://www.apache.org</cv>
-
- <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv>
- <ck>header</ck> =
- <cv><a href='$U{$C{REST/headerLink}}'></cv>
- <cv><img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></cv>
- <cv></a></cv>
- <ck>footer</ck> =
- <cv><a href='$U{$C{REST/footerLink}}'></cv>
- <cv><img src='$U{$C{REST/footerIcon}}'
style='float:right;padding-right:20px;height:32px'/></cv>
- <cv></a></cv>
-</p>
-<p>
- The {@link oajr.BasicRestConfig} interface (which defines the default
settings for {@link oajr.BasicRestServlet}
- pulls in this information using {@link oaj.config.vars.ConfigVar $C}
and {@link oajr.vars.UrlVar $U} variables:
-</p>
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- ...
- <jc>// HTML-page specific settings</jc>
- htmldoc=<ja>@HtmlDoc</ja>(
-
- <jc>// Default page header contents.</jc>
- header={
-
<js>"<h1>$R{resourceTitle}</h1>"</js>, <jc>// Use
@RestResource(title)</jc>
-
<js>"<h2>$R{methodSummary,resourceDescription}</h2>"</js>, <jc>//
Use either @RestMethod(summary) or @RestResource(description)</jc>
- <js>"$C{REST/header}"</js> <jc>// Extra header
HTML defined in external config file.</jc>
- },
-
- <jc>// Default stylesheet to use for the page.
- // Can be overridden from external config file.
- // Default is DevOps look-and-feel (aka Depression
look-and-feel).</jc>
-
stylesheet=<js>"$C{REST/theme,servlet:/htdocs/themes/devops.css}"</js>,
-
- <jc>// Default contents to add to the <head>
section of the HTML page.
- // Use it to add a favicon link to the page.</jc>
- head={
- <js>"<link rel='icon'
href='$U{$C{REST/favicon}}'/>"</js>
- },
-
- <jc>// No default page footer contents.
- // Can be overridden from external config file.</jc>
- footer=<js>"$C{REST/footer}"</js>
- ),
-
- <jc>// Optional external configuration file.</jc>
- config=<js>"$S{juneau.configFile}"</js>,
-
- <jc>// These are static files that are served up by the servlet
under the specified sub-paths.
- // For example, "/servletPath/htdocs/javadoc.css" resolves to
the file "[servlet-package]/htdocs/javadoc.css"
- // By default, we define static files through the external
configuration file.</jc>
- staticFiles=<js>"$C{REST/staticFiles}"</js>
- )
- <jk>public interface</jk> BasicRestConfig {}
-</p>
-<p>
- Note that the <code>files/htdocs</code> directory is mapped to
<js>"servlet:/htdocs"</js> using the <code>staticFiles</code>
- setting. This allows those files to be served up through the servlet
through the URL <js>"/[servlet-path]/htdocs"</js>
-</p>
-<p>
- The theme files are externally accessible and can be modified to
produce any look-and-feel you desire.
- The microservice still works without the files directory. An embedded
<code>devops.css</code> is included in the jar as a default spreadsheet.
-</p>
-<p>
- If you're testing out changes in the theme stylesheets, you may want to
set the following system property that prevents caching of those files so
- that you don't need to restart the microservice each time a change is
made:
-</p>
-<p class='bpcode w800'>
-
<cc>#=======================================================================================================================
- # System properties
-
#-----------------------------------------------------------------------------------------------------------------------
- # These are arbitrary system properties that are set during startup.
-
#=======================================================================================================================</cc>
- <cs>[SystemProperties]</cs>
-
- <cc># Disable classpath resource caching.
- # Useful if you're attached using a debugger and you're modifying
classpath resources while running.</cc>
- <ck>RestContext.useClasspathResourceCaching.b</ck> = <cv>false</cv>
-
-</p>
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Installing.1.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Installing.1.png
similarity index 100%
rename from
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Installing.1.png
rename to
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Installing.1.png
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Installing.2.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Installing.2.png
new file mode 100644
index 0000000..6e81fa5
Binary files /dev/null and
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Installing.2.png
differ
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.ResourceClasses.1.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.ResourceClasses.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.ResourceClasses.1.png
rename to
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.ResourceClasses.1.png
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Running.1.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Running.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Running.1.png
rename to
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.Running.1.png
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice.UiCustomization.1.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.UiCustomization.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice.UiCustomization.1.png
rename to
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-jetty-template.UiCustomization.1.png
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Installing.2.png
b/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Installing.2.png
deleted file mode 100755
index 9caeff9..0000000
Binary files
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Installing.2.png
and /dev/null differ
diff --git a/juneau-doc/docs/Topics/14.juneau-examples-core/01.Examples.html
b/juneau-doc/docs/Topics/14.juneau-examples-core/01.Examples.html
index 2709848..f2a9b5b 100644
--- a/juneau-doc/docs/Topics/14.juneau-examples-core/01.Examples.html
+++ b/juneau-doc/docs/Topics/14.juneau-examples-core/01.Examples.html
@@ -25,17 +25,17 @@
<li class='jc'>{@link
oaj.examples.core.json.JsonComplexExample} - JsonSerializer and JsonParser
usage on serialize and deserialize complex Pojo bean.
<li class='jc'>{@link
oaj.examples.core.json.JsonConfigurationExample}
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.xml</code>
+ <li class='jp'>{@link oaj.examples.core.xml}
<ul>
<li class='jc'>{@link oaj.examples.core.xml.XmlSimpleExample} -
XmlSerializer and XmlParser usage on serialize and deserialize simple Pojo bean.
<li class='jc'>{@link oaj.examples.core.xml.XmlComplexExample}
- XmlSerializer and XmlParser usage on serialize and deserialize complex Pojo
bean.
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.rdf</code>
+ <li class='jp'>{@link oaj.examples.core.rdf}
<ul>
<li class='jc'>{@link oaj.examples.core.rdf.RdfExample} -
RdfXmlSerializer usage on serialize simple Pojo bean.
<li class='jc'>{@link oaj.examples.core.rdf.RdfComplexExample}
- RdfXmlSerializer usage on serialize complex Pojo bean.
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.html</code>
+ <li class='jp'>{@link oaj.examples.core.html}
<ul>
<li class='jc'>{@link
oaj.examples.core.html.HtmlSimpleExample} - HtmlSerializer usage on serialize
simple Pojo bean.
<li class='jc'>{@link
oaj.examples.core.html.HtmlComplexExample} - HtmlSerializer usage on serialize
complex Pojo bean.
diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest-springboot.html
b/juneau-doc/docs/Topics/17.juneau-examples-rest-springboot.html
index 131151b..b9e32db 100644
--- a/juneau-doc/docs/Topics/17.juneau-examples-rest-springboot.html
+++ b/juneau-doc/docs/Topics/17.juneau-examples-rest-springboot.html
@@ -6,7 +6,7 @@
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- * As
+ *
* Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the
* specific language governing permissions and limitations under the License.
diff --git
a/juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Installing.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Installing.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/13.juneau-microservice-jetty-template/doc-files/juneau-microservice-server.Installing.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Installing.1.png
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Installing.2.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Installing.2.png
new file mode 100644
index 0000000..6e81fa5
Binary files /dev/null and
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Installing.2.png
differ
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.ResourceClasses.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.ResourceClasses.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.ResourceClasses.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.ResourceClasses.1.png
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Running.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Running.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice-server.Running.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.Running.1.png
diff --git
a/juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice.UiCustomization.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.UiCustomization.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/12.juneau-microservice-jetty/doc-files/juneau-microservice.UiCustomization.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty-template.UiCustomization.1.png
diff --git
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.ResourceClasses.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.ResourceClasses.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.ResourceClasses.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.ResourceClasses.1.png
diff --git
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Running.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.Running.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice-server.Running.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.Running.1.png
diff --git
a/juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice.UiCustomization.1.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.UiCustomization.1.png
similarity index 100%
rename from
juneau-doc/docs/Topics/11.juneau-microservice-core/doc-files/juneau-microservice.UiCustomization.1.png
rename to
juneau-doc/src/main/javadoc/doc-files/juneau-microservice-jetty.UiCustomization.1.png
diff --git
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Installing.2.png
b/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Installing.2.png
deleted file mode 100755
index 9caeff9..0000000
Binary files
a/juneau-doc/src/main/javadoc/doc-files/juneau-microservice-server.Installing.2.png
and /dev/null differ
diff --git a/juneau-doc/src/main/javadoc/overview.html
b/juneau-doc/src/main/javadoc/overview.html
index ba7f7bb..1b69a7b 100644
--- a/juneau-doc/src/main/javadoc/overview.html
+++ b/juneau-doc/src/main/javadoc/overview.html
@@ -417,30 +417,15 @@
<li><p class='new'><a class='doclink'
href='#juneau-microservice-jetty.UiCustomization'>UI Customization</a></p>
<li><p class='new'><a class='doclink'
href='#juneau-microservice-jetty.Extending'>Extending JettyMicroservice</a></p>
</ol>
- <li><p class='toc2 todo'><a class='doclink'
href='#juneau-microservice-jetty-template'>juneau-microservice-jetty-template</a></p>
+ <li><p class='toc2 new'><a class='doclink'
href='#juneau-microservice-jetty-template'>juneau-microservice-jetty-template</a></p>
<ol>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.Introduction'>Microservice
Introduction</a></p>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted'>Getting
Started</a></p>
+ <li><p class='updated'><a class='doclink'
href='#juneau-microservice-jetty-template.Introduction'>Microservice
Introduction</a></p>
+ <li><p class='updated'><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted'>Getting
Started</a></p>
<ol>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Installing'>Installing
in Eclipse</a></p>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Running'>Running in
Eclipse</a></p>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Building'>Building and
Running from Command-Line</a></p>
+ <li><p class='updated'><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Installing'>Installing
in Eclipse</a></p>
+ <li><p class='updated'><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Running'>Running in
Eclipse</a></p>
+ <li><p class='updated'><a class='doclink'
href='#juneau-microservice-jetty-template.GettingStarted.Building'>Building and
Running from Command-Line</a></p>
</ol>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.Manifest'>Manifest File</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.Manifest.ManifestApi'>Manifest
API</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.Config'>Config</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.Config.ConfigApi'>Config File
API</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.ResourceClasses'>Resource
Classes</a></p>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.PredefinedResourceClasses'>Predefined
Resource Classes</a></p>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.RestMicroservice'>RestMicroservice</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='#juneau-microservice-jetty-template.RestMicroservice.Extending'>Extending
RestMicroservice</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='#juneau-microservice-jetty-template.UiCustomization'>UI
Customization</a></p>
</ol>
<li><p class='toc2 '><a class='doclink'
href='#juneau-examples-core'>juneau-examples-core</a></p>
<ol>
@@ -24493,7 +24478,7 @@
<p class='bpcode w800'>
http://localhost:10000
</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.Running.1.png'>
+<img class='bordered w800'
src='doc-files/juneau-microservice-jetty.Running.1.png'>
<ul class='spaced-list'>
<li>
The </l>title</l> and <l>description</l> annotations define the
titles on the page.
@@ -24514,7 +24499,7 @@
<p class='bpcode w800'>
http://localhost:10000/helloWorld
</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.ResourceClasses.1.png'>
+<img class='bordered w800'
src='doc-files/juneau-microservice-jetty.ResourceClasses.1.png'>
<p>
...which is generated by this class...
</p>
@@ -24927,7 +24912,7 @@
The Microservice project contains a <code>files/htdocs</code> folder
with predefined stylesheets and
images.
</p>
-<img style='width:200px'
src='doc-files/juneau-microservice.UiCustomization.1.png'>
+<img style='width:200px'
src='doc-files/juneau-microservice-jetty.UiCustomization.1.png'>
<p>
These files can be used to tailor the look-and-feel of your
microservice.
</p>
@@ -25116,45 +25101,35 @@
<!--
====================================================================================================
-->
-<h2 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template'
id='juneau-microservice-jetty-template'>13 -
juneau-microservice-jetty-template</a></h2>
+<h2 class='topic new' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template'
id='juneau-microservice-jetty-template'>13 -
juneau-microservice-jetty-template</a></h2>
<div class='topic'><!-- START: 13 - juneau-microservice-jetty-template -->
<h5 class='figure'>Maven Dependency</h5>
<p class='bpcode w500'>
<xt><dependency></xt>
<xt><groupId></xt>org.apache.juneau<xt></groupId></xt>
-
<xt><artifactId></xt>juneau-microservice-server<xt></artifactId></xt>
+
<xt><artifactId></xt>juneau-microservice-jetty-template<xt></artifactId></xt>
<xt><version></xt>{@property
juneauVersion}<xt></version></xt>
<xt></dependency></xt>
</p>
-<h5 class='figure'>Java Library</h5>
-<p class='bpcode w500'>
- juneau-microservice-server-{@property juneauVersion}.jar
-</p>
-
-<h5 class='figure'>OSGi Module</h5>
-<p class='bpcode w500'>
- org.apache.juneau.microservice.jetty.server_{@property
juneauVersion}.jar
-</p>
-
<h5 class='figure'>Microservice Starter Project</h5>
<p class='bpcode w500'>
- my-microservice.zip
+ my-microservice-jetty-{@property juneauVersion}.zip
</p>
<p>
- Juneau Microservice is an API for creating stand-alone executable jars
that can be used to
- start lightweight configurable REST interfaces with all the power of
the Juneau REST server and client APIs.
+ The <l>my-microservice-jetty.zip</l> file is a predefined starter
Eclipse project for developing
+ REST microservices using the {@doc juneau-microservice-jetty} package.
</p>
<!--
====================================================================================================
-->
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Introduction'
id='juneau-microservice-jetty-template.Introduction'>13.1 - Microservice
Introduction</a></h3>
+<h3 class='topic updated' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Introduction'
id='juneau-microservice-jetty-template.Introduction'>13.1 - Microservice
Introduction</a></h3>
<div class='topic'><!-- START: 13.1 -
juneau-microservice-jetty-template.Introduction -->
<p>
The Microservice API consists of a combination of the Juneau Core,
Server, and Client APIs and an embedded
Eclipse Jetty Servlet Container.
- <br>It includes all libraries needed to execute in a Java 1.7+
environment.
+ <br>It includes all libraries needed to execute in a Java 1.8+
environment.
</p>
<p>
Features include:
@@ -25163,7 +25138,7 @@
<li>
An out-of-the-box zipped Eclipse project to get started quickly.
<li>
- Packaged as a simple executable jar and configuration file.
+ Buildable as a simple executable jar and configuration file.
<li>
All the power of the Juneau ecosystem for defining REST
servlets and clients with the ability to
serialize and parse POJOs as HTML, JSON, XML, RDF,
URL-Encoding, and others.
@@ -25175,57 +25150,61 @@
<li>
Predefined REST resources for configuring microservice and
accessing log files.
</ul>
-<p>
- The <code>juneau-microservice-server</code> library consists of the
following classes:
-</p>
-<ul class='doctree'>
- <li class='jac'>
- {@link org.apache.juneau.microservice.Microservice}
- - Defines basic lifecycle methods for microservices in general.
- <ul>
- <li class='jc'>
- {@link
org.apache.juneau.microservice.RestMicroservice}
- - Defines additional lifecycle methods for REST
microservices.
- <br>Starts up an externally-configured Jetty
server, registers servlets, and sets up
- other features such as logging.
- </ul>
-</ul>
</div><!-- END: 13.1 - juneau-microservice-jetty-template.Introduction -->
<!--
====================================================================================================
-->
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted'
id='juneau-microservice-jetty-template.GettingStarted'>13.2 - Getting
Started</a></h3>
+<h3 class='topic updated' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted'
id='juneau-microservice-jetty-template.GettingStarted'>13.2 - Getting
Started</a></h3>
<div class='topic'><!-- START: 13.2 -
juneau-microservice-jetty-template.GettingStarted -->
<p>
- The <l>my-microservice.zip</l> file is a zipped eclipse project that
includes everything you
+ The <l>my-microservice-jetty.zip</l> file is a zipped eclipse project
that includes everything you
need to create a REST microservice in an Eclipse workspace.
</p>
<!--
====================================================================================================
-->
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Installing'
id='juneau-microservice-jetty-template.GettingStarted.Installing'>13.2.1 -
Installing in Eclipse</a></h4>
+<h4 class='topic updated' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Installing'
id='juneau-microservice-jetty-template.GettingStarted.Installing'>13.2.1 -
Installing in Eclipse</a></h4>
<div class='topic'><!-- START: 13.2.1 -
juneau-microservice-jetty-template.GettingStarted.Installing -->
<p>
Follow these instructions to create a new template project in Eclipse.
</p>
<ol class='spaced-list'>
<li>
- Download the latest microservice-project zip file (e.g.
<l>my-microservice.zip</l>).
+ Download the latest <l>my-jetty-microservice.zip</l> file.
<li>
In your Eclipse workspace, go to <b>File -> Import ->
General -> Existing Projects into Workspace</b>
and select the zip file and click <b>Finish</b>.
<br><br>
- <img class='bordered'
src='doc-files/juneau-microservice-server.Installing.1.png' style='width:549px'>
+ <img class='bordered'
src='doc-files/juneau-microservice-jetty-template.Installing.1.png'
style='width:549px'>
<li>
In your workspace, you should now see the following project:
<br><br>
- <img class='bordered'
src='doc-files/juneau-microservice-server.Installing.2.png' style='width:299px'>
+ <img class='bordered'
src='doc-files/juneau-microservice-jetty-template.Installing.2.png'
style='width:400px'>
</ol>
<p>
The important elements in this project are:
</p>
<ul class='spaced-list'>
<li>
+ <l>App.java</l> - The entry point.
+ <br>This class creates and starts our microservice:
+ <br><br>
+ <p class='bcode w800'>
+ <jk>public class</jk> App {
+
+ <jk>public static void</jk> main(String[] args) <jk>throws</jk>
Exception {
+ JettyMicroservice
+ .<jsm>create</jsm>()
+ .args(args)
+ .servlet(RootResources.<jk>class</jk>)
+ .build()
+ .start()
+ .startConsole()
+ .join();
+ }
+ }
+ </p>
+ <li>
<l>RootResources.java</l> - The top-level REST resource.
<br>This class routes HTTP requests to child resources:
<br><br>
@@ -25264,13 +25243,6 @@
# Subprojects can use this as a starting point.
#=======================================================================================================================</cc>
- <cc># What to do when the config file is saved.
- # Possible values:
- # NOTHING - Don't do anything. (default)
- # RESTART_SERVER - Restart the Jetty server.
- # RESTART_SERVICE - Shutdown and exit with code '3'.</cc>
- <ck>saveConfigAction</ck> = <cv>RESTART_SERVER</cv>
-
<cc>#=======================================================================================================================
# Jetty settings
#=======================================================================================================================</cc>
@@ -25288,17 +25260,34 @@
# jetty.xml file as "$S{availablePort}" (assuming resolveVars is
enabled).</cc>
<ck>port</ck> = <cv>10000,0,0,0</cv>
+ <cc># Optionally specify your servlets here:
+ #servlets = org.apache.juneau.microservice.sample.RootResources</cc>
+
<cc>#=======================================================================================================================
# REST settings
#=======================================================================================================================</cc>
<cs>[REST]</cs>
- <cc># Stylesheet to use for HTML views.
- # The default options are:
- # - servlet:/styles/juneau.css
- # - servlet:/styles/devops.css
- # Other stylesheets can be referenced relative to the servlet package
or working directory.</cc>
- <ck>stylesheet</ck> = <cv>servlet:/styles/devops.css</cv>
+ <cc># URL mappings to static files in the working directory or
classpath.</cc>
+ <ck>staticFiles</ck> = htdocs:files/htdocs
+
+ <cc># Stylesheet to use for HTML views.</cc>
+ <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv>
+
+ <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv>
+ <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv>
+ <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv>
+ <ck>footerLink</ck> = <cv>http://www.apache.org</cv>
+
+ <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv>
+ <ck>header</ck> =
+ <cv><a href='$U{$C{REST/headerLink}}'>
+ <img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>
+ </a></cv>
+ <ck>footer</ck> =
+ <cv><a href='$U{$C{REST/footerLink}}'>
+ <img src='$U{$C{REST/footerIcon}}'
style='float:right;padding-right:20px;height:32px'/>
+ </a></cv>
<cc>#=======================================================================================================================
# Console settings
@@ -25367,10 +25356,11 @@
<xt><New</xt> <xa>id</xa>=<xs>"context"</xs>
<xa>class</xa>=<xs>"org.eclipse.jetty.servlet.ServletContextHandler"</xs><xt>></xt>
<xt><Set</xt>
<xa>name</xa>=<xs>"contextPath"</xs><xt>>/</Set></xt>
- <xt><Call</xt>
<xa>name</xa>=<xs>"addServlet"</xs><xt>></xt>
-
<xt><Arg></xt>org.apache.juneau.microservice.sample.RootResources<xt></Arg></xt>
- <xt><Arg></xt>/*<xt></Arg></xt>
- <xt></Call></xt>
+ <xc><!-- Optionally specify your servlets here -->
+ <!--Call name="addServlet">
+
<Arg>org.apache.juneau.microservice.sample.RootResources</Arg>
+ <Arg>/*</Arg>
+ </Call--></xc>
<xt><Set</xt>
<xa>name</xa>=<xs>"sessionHandler"</xs><xt>></xt>
<xt><New</xt>
<xa>class</xa>=<xs>"org.eclipse.jetty.server.session.SessionHandler"</xs><xt>/></xt>
<xt></Set></xt>
@@ -25418,7 +25408,7 @@
<!--
====================================================================================================
-->
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Running'
id='juneau-microservice-jetty-template.GettingStarted.Running'>13.2.2 - Running
in Eclipse</a></h4>
+<h4 class='topic updated' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Running'
id='juneau-microservice-jetty-template.GettingStarted.Running'>13.2.2 - Running
in Eclipse</a></h4>
<div class='topic'><!-- START: 13.2.2 -
juneau-microservice-jetty-template.GettingStarted.Running -->
<p>
The <l>my-microservice.launch</l> file is already provided to allow you
to quickly start
@@ -25446,7 +25436,7 @@
<p class='bpcode w400'>
http://localhost:10000
</p>
-<img class='bordered w400'
src='doc-files/juneau-microservice-server.Running.1.png'>
+<img class='bordered w400'
src='doc-files/juneau-microservice-jetty-template.Running.1.png'>
<p>
You have started a REST interface on port 10000.
<br>You can enter the command <code>exit</code> to shut it down.
@@ -25455,7 +25445,7 @@
<!--
====================================================================================================
-->
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Building'
id='juneau-microservice-jetty-template.GettingStarted.Building'>13.2.3 -
Building and Running from Command-Line</a></h4>
+<h4 class='topic updated' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.GettingStarted.Building'
id='juneau-microservice-jetty-template.GettingStarted.Building'>13.2.3 -
Building and Running from Command-Line</a></h4>
<div class='topic'><!-- START: 13.2.3 -
juneau-microservice-jetty-template.GettingStarted.Building -->
<p>
The <l>pom.xml</l> file is a basic Maven build script for creating your
microservice
@@ -25473,7 +25463,6 @@
<ul>
<li><code>my-microservice-1.0.jar</code>
<li><code>my-microservice.cfg</code>
- <li><code>jetty.xml</code>
</ul>
<p>
To start from a command line, run the following command from inside
your <code>target</code> directory:
@@ -25501,475 +25490,6 @@
</p>
</div><!-- END: 13.2.3 -
juneau-microservice-jetty-template.GettingStarted.Building -->
</div><!-- END: 13.2 - juneau-microservice-jetty-template.GettingStarted -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Manifest'
id='juneau-microservice-jetty-template.Manifest'>13.3 - Manifest File</a></h3>
-<div class='topic'><!-- START: 13.3 -
juneau-microservice-jetty-template.Manifest -->
-<p>
- The generated <l>META-INF/MANIFEST.MF</l> file is used to describe the
microservice.
- <br>If you open it, you'll see the following:
-</p>
-<p class='bpcode w800'>
- <mk>Main-Class</mk>:
<mv>org.apache.juneau.microservice.jetty.RestMicroservice</mv>
- <mk>Main-ConfigFile</mk>: <mv>my-microservice.cfg</mv>
-<p>
- The <mk>Main-Class</mk> entry is the standard manifest entry describing
the entry point for the executable jar.
- <br>In most cases, this value will always be
<l>org.apache.juneau.microservice.jetty.RestMicroservice</l>.
- <br>However, it is possible to extend this class or implement your own
microservice, in which case you'll need
- to modify this value to point to the new class.
-</p>
-<p>
- The <mk>Main-ConfigFile</mk> entry points to the location of an
external configuration file for our microservice.
-</p>
-<p>
- In addition to these predefined manifest entries, you can add your own
particular entries to the manifest file
- and access them through the Manifest API described next.
-</p>
-
-<!--
====================================================================================================
-->
-
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Manifest.ManifestApi'
id='juneau-microservice-jetty-template.Manifest.ManifestApi'>13.3.1 - Manifest
API</a></h4>
-<div class='topic'><!-- START: 13.3.1 -
juneau-microservice-jetty-template.Manifest.ManifestApi -->
-<p>
- The {@link org.apache.juneau.microservice.Microservice#getManifest()}
method is a static method that
- can be used to retrieve the manifest file as a {@link
org.apache.juneau.utils.ManifestFile}.
-</p>
-<p class='bpcode w800'>
- <jc>// Get Main-Class from manifest file.</jc>
- String mainClass =
Microservice.<jsm>getInstance</jsm>().getManifest().getString(<js>"Main-Class"</js>,
<js>"unknown"</js>);
-</p>
-<p>
- The {@link org.apache.juneau.utils.ManifestFile} class extends {@link
org.apache.juneau.ObjectMap},
- making it possible to retrieve entries as a wide variety of object
types such as java primitives, arrays, collections,
- maps, or even POJOs serialized as JSON.
-</p>
-</div><!-- END: 13.3.1 -
juneau-microservice-jetty-template.Manifest.ManifestApi -->
-</div><!-- END: 13.3 - juneau-microservice-jetty-template.Manifest -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Config'
id='juneau-microservice-jetty-template.Config'>13.4 - Config</a></h3>
-<div class='topic'><!-- START: 13.4 -
juneau-microservice-jetty-template.Config -->
-<p>
- The microservice config file is an external INI-style configuration
file that is used to configure
- your microservice.
-</p>
-<h5 class='section'>See Also:</h5>
-<ul class='doctree'>
- <li class='link'>{@doc juneau-config}
-</ul>
-
-<!--
====================================================================================================
-->
-
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.Config.ConfigApi'
id='juneau-microservice-jetty-template.Config.ConfigApi'>13.4.1 - Config File
API</a></h4>
-<div class='topic'><!-- START: 13.4.1 -
juneau-microservice-jetty-template.Config.ConfigApi -->
-<p>
- There are 3 primary ways of getting access to the config file.
-</p>
-<ul class='doctree'>
- <li class='jm'>{@link
org.apache.juneau.microservice.Microservice#getConfig()}
- <br>Any {@doc DefaultRestSvlVariables initialization-time
variables} can be used.
- <li class='jm'>{@link org.apache.juneau.rest.RestContext#getConfig()}
- <br>Any {@doc DefaultRestSvlVariables initialization-time
variables} can be used.
- <h5 class='figure'>Example usage:</h5>
- <p class='bcode w800'>
- <cc>#-------------------------------</cc>
- <cc># Properties for MyHelloResource </cc>
- <cc>#-------------------------------</cc>
- <cs>[MyHelloResource]</cs>
- <ck>greeting</ck> = <cv>Hello world!</cv>
- </p>
- <p class='bcode w800'>
- <ja>@RestResource</ja>(...)
- <jk>public class</jk> MyHelloResource <jk>extends</jk> BasicRestServlet
{
- <jc>// Access config file when initializing fields.</jc>
- <jk>private</jk> String greeting =
getConfig().getString(<js>"MyHelloResource/greeting"</js>);
-
- <jc>// Or access config file in servlet init method.</jc>
- <ja>@Override</ja> <jc>/* Servlet */</jc>
- <jk>public void</jk> init() {
- String greeting =
getConfig().getString(<js>"MyHelloResource/greeting"</js>);
- }
- }
- </p>
- <p>
- Additional user-defined variables can be defined at
this level by adding a
- {@link
org.apache.juneau.rest.annotation.HookEvent#INIT} hook method
- and using the {@link
org.apache.juneau.rest.RestContextBuilder#vars(Class...)} method.
- </p>
- <li class='jm'>
- {@link org.apache.juneau.rest.RestRequest#getConfig()}
- - An instance method to access it from inside a REST method.
- <br>Any {@doc DefaultRestSvlVariables initialization-time or
request-time variables} can be used.
-
- <h5 class='figure'>Example usage:</h5>
- <p class='bcode w800'>
- <cc>#-----------------------------</cc>
- <cc># Contents of microservice.cfg </cc>
- <cc>#-----------------------------</cc>
- <cs>[MyHelloResource]</cs>
- <ck>greeting</ck> = <cv>Hello $RP{person}!</cv>
- <ck>localizedGreeting</ck> = <cv>$L{HelloMessage,$RP{person}}</cv>
- </p>
- <p class='bcode w800'>
- <cc>#---------------------------------</cc>
- <cc># Contents of MyHelloResource.java </cc>
- <cc>#---------------------------------</cc>
- <ja>@RestResource</ja>(
- path=<js>"/hello"</js>,
- messages=<js>"nls/Messages"</js>,
- ...
- )
- <jk>public class</jk> MyHelloResource <jk>extends</jk> BasicRestServlet
{
-
- <jd>/** Standard hello message. */</jd>
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>,
path=<js>"/{person}"</js>)
- <jk>public</jk> String sayHello(RestRequest req) {
- <jk>return</jk>
req.getConfig().getString(<js>"MyHelloResource/greeting"</js>);
- }
-
- <jd>/** Hello message in users language. */</jd>
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>,
path=<js>"/localized/{person}"</js>)
- <jk>public</jk> String sayLocalizedHello(RestRequest req) {
- <jk>return</jk>
req.getConfig().getString(<js>"MyHelloResource/localizedGreeting"</js>);
- }
- }
- </p>
- <p class='bcode w800'>
- <cc>#---------------------------------------</cc>
- <cc># Contents of nls/Messages_en.properties </cc>
- <cc>#---------------------------------------</cc>
- <ck>MyHelloResource.HelloMessage</ck> = <cv>Hello {0}!</cv>
- </p>
- <p>
- Additional user-defined variables can be defined at
this level by overriding the
- {@link
org.apache.juneau.rest.RestContextBuilder#vars(Class...)} method.
- </p>
-</ul>
-<p>
- That <l>sayLocalizedHello()</l> example might need some explanation
since there's a lot going on there.
- <br>Here's what happens when an HTTP call is made to <l>GET
/hello/localized/Bob</l>:
-</p>
-<ol class='spaced-list'>
- <li>
- The HTTP call matches the <l>/hello</l> path on the
<l>MyHelloResource</l> class.
- <li>
- The HTTP call matches the <l>/localized/{person}</l> path on
the <l>sayLocalizedHello()</l> method.
- <li>
- The request attribute <l>person</l> gets assigned the value
<l>"Bob"</l>.
- <li>
- The call to
<l>req.getConfig().getString("MyHelloResource/localizedGreeting")</l>
- finds the value <l>"$L{HelloMessage,$RP{person}}"</l>.
- <li>
- The arguments in the <l>$L{}</l> variable get resolved,
resulting in <l>"$L{HelloMessage,Bob}"</l>.
- <li>
- The <l>$L{}</l> variable gets resolved to the message <l>"Hello
{0}!"</l> in the localized properties
- file of the servlet based on the <l>Accept-Language</l> header
on the request.
- <li>
- The arguments get replaced in the message resulting in
<l>"Hello Bob!"</l>.
- <li>
- The resulting message <l>"Hello Bob!"</l> is returned as a POJO
to be serialized to whatever content
- type was specified on the <l>Accept</l> header on the request.
-</ol>
-<p>
- This particular example is needlessly complex, but it gives an idea of
how variables can be used
- recursively to produce sophisticated results
-</p>
-</div><!-- END: 13.4.1 - juneau-microservice-jetty-template.Config.ConfigApi
-->
-</div><!-- END: 13.4 - juneau-microservice-jetty-template.Config -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.ResourceClasses'
id='juneau-microservice-jetty-template.ResourceClasses'>13.5 - Resource
Classes</a></h3>
-<div class='topic'><!-- START: 13.5 -
juneau-microservice-jetty-template.ResourceClasses -->
-<p>
- Now let's take a look at the resource classes themselves.
- <br>The top-level page...
-</p>
-<p class='bpcode w800'>
- http://localhost:10000
-</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.Running.1.png'>
-<p>
- ...is generated by this class...
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- path=<js>"/"</js>,
- title=<js>"My Microservice"</js>,
- description=<js>"Top-level resources page"</js>,
- htmldoc=<ja>@HtmlDoc</ja>(
- navlinks={
- <js>"options: servlet:/?method=OPTIONS"</js>
- }
- ),
- children={
- HelloWorldResource.<jk>class</jk>,
- ConfigResource.<jk>class</jk>,
- LogsResource.<jk>class</jk>
- }
- )
- <jk>public class</jk> RootResources <jk>extends</jk>
BasicRestServletJenaGroup {
- <jc>// No code! </jc>
- }
-</p>
-<ul class='spaced-list'>
- <li>
- The </l>title</l> and <l>description</l> annotations define the
titles on the page.
- <br>These can be globalized using <l>$L{...}</l> variables, or
by defining specially-named properties in the
- properties file for the resource.
- <li>
- In this case, the <l>path</l> annotation defines the context
root of your application since it was
- not specified in the manifest or config file.
- <br>Therefore, this resource is mapped to
<l>http://localhost:10000</l>.
- <li>
- The <l>children</l> annotation make up the list of child
resources.
- <br>These child resources can be anything that extends from
<l>Servlet</l>, although usually
- they will be subclasses of {@link
org.apache.juneau.rest.BasicRestServlet} or other resource groups.
-</ul>
-<p>
- If you click the <l>helloWorld</l> link in your application, you'll get
a simple hello world message:
-</p>
-<p class='bpcode w800'>
- http://localhost:10000/helloWorld
-</p>
-<img class='bordered w800'
src='doc-files/juneau-microservice-server.ResourceClasses.1.png'>
-<p>
- ...which is generated by this class...
-</p>
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- path=<js>"/helloWorld"</js>,
- title=<js>"Hello World example"</js>,
- description=<js>"Simplest possible REST resource"</js>
- )
- <jk>public class</jk> HelloWorldResource <jk>extends</jk>
BasicRestServlet {
-
- <ja>@RestMethod</ja>(name=<jsf>GET</jsf>, path=<js>"/*"</js>)
- <jk>public</jk> String sayHello() {
- <jk>return</jk> <js>"Hello world!"</js>;
- }
- }
-</p>
-</div><!-- END: 13.5 - juneau-microservice-jetty-template.ResourceClasses -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.PredefinedResourceClasses'
id='juneau-microservice-jetty-template.PredefinedResourceClasses'>13.6 -
Predefined Resource Classes</a></h3>
-<div class='topic'><!-- START: 13.6 -
juneau-microservice-jetty-template.PredefinedResourceClasses -->
-<p>
- The following predefined resource classes are also provided for easy
inclusion into your microservice:
-</p>
-<ul class='doctree'>
- <li class='jc'>{@link
org.apache.juneau.microservice.resources.ConfigResource}
- - View and modify the external INI config file.
- <li class='jc'>{@link
org.apache.juneau.microservice.resources.DirectoryResource}
- - View and modify file system directories.
- <li class='jc'>{@link
org.apache.juneau.microservice.resources.LogsResource}
- - View and control generated log files.
- <li class='jc'>{@link
org.apache.juneau.microservice.resources.SampleRootResource}
- - A sample root resource class to get started from.
- <li class='jc'>{@link
org.apache.juneau.microservice.resources.ShutdownResource}
- - Shutdown and/or restart the JVM.
-</ul>
-</div><!-- END: 13.6 -
juneau-microservice-jetty-template.PredefinedResourceClasses -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.RestMicroservice'
id='juneau-microservice-jetty-template.RestMicroservice'>13.7 -
RestMicroservice</a></h3>
-<div class='topic'><!-- START: 13.7 -
juneau-microservice-jetty-template.RestMicroservice -->
-<p>
- The {@link org.apache.juneau.microservice.RestMicroservice} class is
the main application entry-point for REST
- microservices.
-</p>
-<p>
- The class hierarchy is:
-</p>
-<ul class='doctree'>
- <li class='jac'>
- {@link org.apache.juneau.microservice.Microservice}
- - Abstract class that defines simple start/stop methods and
access to the manifest file, config file, and
- arguments.
- <ul>
- <li class='jc'>
- {@link
org.apache.juneau.microservice.RestMicroservice}
- - Specialized microservice for starting up REST
interfaces using Jetty and specifying REST servlets
- through the manifest file or config file.
- </ul>
- </li>
-</ul>
-<p>
- Refer to the Javadocs for these class for more information.
-</p>
-
-<!--
====================================================================================================
-->
-
-<h4 class='topic ' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.RestMicroservice.Extending'
id='juneau-microservice-jetty-template.RestMicroservice.Extending'>13.7.1 -
Extending RestMicroservice</a></h4>
-<div class='topic'><!-- START: 13.7.1 -
juneau-microservice-jetty-template.RestMicroservice.Extending -->
-<p>
- This example shows how the {@link
org.apache.juneau.microservice.RestMicroservice} class
- can be extended to implement lifecycle listener methods or override
existing methods.
- <br>We'll create a new class
<l>com.foo.SampleCustomRestMicroservice</l>.
-</p>
-<p>
- First, the manifest file needs to be modified to point to our new
microservice:
-</p>
-<p class='bpcode w800'>
- <mk>Main-Class:</mk> com.foo.SampleCustomRestMicroservice
-</p>
-<p>
- Then we define the following class:
-</p>
-<p class='bpcode w800'>
- <jd>/**
- * Sample subclass of a RestMicroservice that provides customized
behavior.
- * This class must be specified in the Main-Class entry in the manifest
file and optionally
- * a Main-ConfigFile entry.
- */</jd>
- <jk>public class</jk> SampleCustomRestMicroservice <jk>extends</jk>
RestMicroservice {
-
- <jd>/**
- * Must implement a main method and call start()!
- */</jd>
- <jk>public static void</jk> main(String[] args) <jk>throws</jk>
Exception {
- <jk>new</jk>
SampleCustomRestMicroservice(args).start().join();
- }
-
- <jd>/**
- * Must implement a constructor!
- *
- * <ja>@param</ja> args Command line arguments.
- * <ja>@throws</ja> Exception
- */</jd>
- <jk>public</jk> SampleCustomRestMicroservice(String[] args)
<jk>throws</jk> Exception {
- <jk>super</jk>(args);
- }
-</p>
-<p>
- The microservice APIs provide several useful methods that can be used
or extended.
-</p>
-<h5 class='section'>See Also:</h5>
-<ul class='doctree'>
- <li class='jac'>{@link org.apache.juneau.microservice.Microservice}
- <li class='jc'>{@link org.apache.juneau.microservice.RestMicroservice}
-</ul>
-</div><!-- END: 13.7.1 -
juneau-microservice-jetty-template.RestMicroservice.Extending -->
-</div><!-- END: 13.7 - juneau-microservice-jetty-template.RestMicroservice -->
-
-<!--
====================================================================================================
-->
-
-<h3 class='topic todo' onclick='toggle(this)'><a
href='#juneau-microservice-jetty-template.UiCustomization'
id='juneau-microservice-jetty-template.UiCustomization'>13.8 - UI
Customization</a></h3>
-<div class='topic'><!-- START: 13.8 -
juneau-microservice-jetty-template.UiCustomization -->
-<p>
- The Microservice project contains a <code>files/htdocs</code> working
directly folder with predefined stylesheets and
- images.
-</p>
-<img style='width:200px'
src='doc-files/juneau-microservice.UiCustomization.1.png'>
-<p>
- These files can be used to tailor the look-and-feel of your
microservice.
-</p>
-<p class='bpcode w800'>
- http://localhost:10000/helloWorld
-</p>
-<img class='bordered w800'
src='doc-files/juneau-rest-server.UiCustomization.1.png'>
-<p>
- The REST configuration section of your microservice configuration file
can be used to tailor the header and footer on the pages:
-</p>
-<p class='bpcode w800'>
-
<cc>#=======================================================================================================================
- # REST settings
-
#=======================================================================================================================</cc>
- <cs>[REST]</cs>
-
- <ck>staticFiles</ck> = <cv>htdocs:files/htdocs</cv>
-
- <cc># Stylesheet to use for HTML views.</cc>
- <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv>
-
- <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv>
- <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv>
- <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv>
- <ck>footerLink</ck> = <cv>http://www.apache.org</cv>
-
- <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv>
- <ck>header</ck> =
- <cv><a href='$U{$C{REST/headerLink}}'></cv>
- <cv><img src='$U{$C{REST/headerIcon}}'
style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></cv>
- <cv></a></cv>
- <ck>footer</ck> =
- <cv><a href='$U{$C{REST/footerLink}}'></cv>
- <cv><img src='$U{$C{REST/footerIcon}}'
style='float:right;padding-right:20px;height:32px'/></cv>
- <cv></a></cv>
-</p>
-<p>
- The {@link org.apache.juneau.rest.BasicRestConfig} interface (which
defines the default settings for {@link
org.apache.juneau.rest.BasicRestServlet}
- pulls in this information using {@link
org.apache.juneau.config.vars.ConfigVar $C} and {@link
org.apache.juneau.rest.vars.UrlVar $U} variables:
-</p>
-<p class='bpcode w800'>
- <ja>@RestResource</ja>(
- ...
- <jc>// HTML-page specific settings</jc>
- htmldoc=<ja>@HtmlDoc</ja>(
-
- <jc>// Default page header contents.</jc>
- header={
-
<js>"<h1>$R{resourceTitle}</h1>"</js>, <jc>// Use
@RestResource(title)</jc>
-
<js>"<h2>$R{methodSummary,resourceDescription}</h2>"</js>, <jc>//
Use either @RestMethod(summary) or @RestResource(description)</jc>
- <js>"$C{REST/header}"</js> <jc>// Extra header
HTML defined in external config file.</jc>
- },
-
- <jc>// Default stylesheet to use for the page.
- // Can be overridden from external config file.
- // Default is DevOps look-and-feel (aka Depression
look-and-feel).</jc>
-
stylesheet=<js>"$C{REST/theme,servlet:/htdocs/themes/devops.css}"</js>,
-
- <jc>// Default contents to add to the <head>
section of the HTML page.
- // Use it to add a favicon link to the page.</jc>
- head={
- <js>"<link rel='icon'
href='$U{$C{REST/favicon}}'/>"</js>
- },
-
- <jc>// No default page footer contents.
- // Can be overridden from external config file.</jc>
- footer=<js>"$C{REST/footer}"</js>
- ),
-
- <jc>// Optional external configuration file.</jc>
- config=<js>"$S{juneau.configFile}"</js>,
-
- <jc>// These are static files that are served up by the servlet
under the specified sub-paths.
- // For example, "/servletPath/htdocs/javadoc.css" resolves to
the file "[servlet-package]/htdocs/javadoc.css"
- // By default, we define static files through the external
configuration file.</jc>
- staticFiles=<js>"$C{REST/staticFiles}"</js>
- )
- <jk>public interface</jk> BasicRestConfig {}
-</p>
-<p>
- Note that the <code>files/htdocs</code> directory is mapped to
<js>"servlet:/htdocs"</js> using the <code>staticFiles</code>
- setting. This allows those files to be served up through the servlet
through the URL <js>"/[servlet-path]/htdocs"</js>
-</p>
-<p>
- The theme files are externally accessible and can be modified to
produce any look-and-feel you desire.
- The microservice still works without the files directory. An embedded
<code>devops.css</code> is included in the jar as a default spreadsheet.
-</p>
-<p>
- If you're testing out changes in the theme stylesheets, you may want to
set the following system property that prevents caching of those files so
- that you don't need to restart the microservice each time a change is
made:
-</p>
-<p class='bpcode w800'>
-
<cc>#=======================================================================================================================
- # System properties
-
#-----------------------------------------------------------------------------------------------------------------------
- # These are arbitrary system properties that are set during startup.
-
#=======================================================================================================================</cc>
- <cs>[SystemProperties]</cs>
-
- <cc># Disable classpath resource caching.
- # Useful if you're attached using a debugger and you're modifying
classpath resources while running.</cc>
- <ck>RestContext.useClasspathResourceCaching.b</ck> = <cv>false</cv>
-
-</p>
-</div><!-- END: 13.8 - juneau-microservice-jetty-template.UiCustomization -->
</div><!-- END: 13 - juneau-microservice-jetty-template -->
<!--
====================================================================================================
-->
@@ -26023,17 +25543,17 @@
<li class='jc'>{@link
org.apache.juneau.examples.core.json.JsonComplexExample} - JsonSerializer and
JsonParser usage on serialize and deserialize complex Pojo bean.
<li class='jc'>{@link
org.apache.juneau.examples.core.json.JsonConfigurationExample}
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.xml</code>
+ <li class='jp'>{@link org.apache.juneau.examples.core.xml}
<ul>
<li class='jc'>{@link
org.apache.juneau.examples.core.xml.XmlSimpleExample} - XmlSerializer and
XmlParser usage on serialize and deserialize simple Pojo bean.
<li class='jc'>{@link
org.apache.juneau.examples.core.xml.XmlComplexExample} - XmlSerializer and
XmlParser usage on serialize and deserialize complex Pojo bean.
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.rdf</code>
+ <li class='jp'>{@link org.apache.juneau.examples.core.rdf}
<ul>
<li class='jc'>{@link
org.apache.juneau.examples.core.rdf.RdfExample} - RdfXmlSerializer usage on
serialize simple Pojo bean.
<li class='jc'>{@link
org.apache.juneau.examples.core.rdf.RdfComplexExample} - RdfXmlSerializer usage
on serialize complex Pojo bean.
</ul>
- <li class='jp'><code>org.apache.juneau.examples.core.html</code>
+ <li class='jp'>{@link org.apache.juneau.examples.core.html}
<ul>
<li class='jc'>{@link
org.apache.juneau.examples.core.html.HtmlSimpleExample} - HtmlSerializer usage
on serialize simple Pojo bean.
<li class='jc'>{@link
org.apache.juneau.examples.core.html.HtmlComplexExample} - HtmlSerializer usage
on serialize complex Pojo bean.
diff --git a/juneau-doc/src/main/javadoc/resources/docs.txt
b/juneau-doc/src/main/javadoc/resources/docs.txt
index ace5c1d..2f9ea12 100644
--- a/juneau-doc/src/main/javadoc/resources/docs.txt
+++ b/juneau-doc/src/main/javadoc/resources/docs.txt
@@ -216,20 +216,11 @@ juneau-microservice-core.SystemProperties =
#juneau-microservice-core.SystemProp
juneau-microservice-core.VarResolver = #juneau-microservice-core.VarResolver,
Overview > juneau-microservice-core > VarResolver
juneau-microservice-jetty = #juneau-microservice-jetty, Overview >
juneau-microservice-jetty
juneau-microservice-jetty-template = #juneau-microservice-jetty-template,
Overview > juneau-microservice-jetty-template
-juneau-microservice-jetty-template.Config =
#juneau-microservice-jetty-template.Config, Overview >
juneau-microservice-jetty-template > Config
-juneau-microservice-jetty-template.Config.ConfigApi =
#juneau-microservice-jetty-template.Config.ConfigApi, Overview >
juneau-microservice-jetty-template > Config > Config File API
juneau-microservice-jetty-template.GettingStarted =
#juneau-microservice-jetty-template.GettingStarted, Overview >
juneau-microservice-jetty-template > Getting Started
juneau-microservice-jetty-template.GettingStarted.Building =
#juneau-microservice-jetty-template.GettingStarted.Building, Overview >
juneau-microservice-jetty-template > Getting Started > Building and Running
from Command-Line
juneau-microservice-jetty-template.GettingStarted.Installing =
#juneau-microservice-jetty-template.GettingStarted.Installing, Overview >
juneau-microservice-jetty-template > Getting Started > Installing in Eclipse
juneau-microservice-jetty-template.GettingStarted.Running =
#juneau-microservice-jetty-template.GettingStarted.Running, Overview >
juneau-microservice-jetty-template > Getting Started > Running in Eclipse
juneau-microservice-jetty-template.Introduction =
#juneau-microservice-jetty-template.Introduction, Overview >
juneau-microservice-jetty-template > Microservice Introduction
-juneau-microservice-jetty-template.Manifest =
#juneau-microservice-jetty-template.Manifest, Overview >
juneau-microservice-jetty-template > Manifest File
-juneau-microservice-jetty-template.Manifest.ManifestApi =
#juneau-microservice-jetty-template.Manifest.ManifestApi, Overview >
juneau-microservice-jetty-template > Manifest File > Manifest API
-juneau-microservice-jetty-template.PredefinedResourceClasses =
#juneau-microservice-jetty-template.PredefinedResourceClasses, Overview >
juneau-microservice-jetty-template > Predefined Resource Classes
-juneau-microservice-jetty-template.ResourceClasses =
#juneau-microservice-jetty-template.ResourceClasses, Overview >
juneau-microservice-jetty-template > Resource Classes
-juneau-microservice-jetty-template.RestMicroservice =
#juneau-microservice-jetty-template.RestMicroservice, Overview >
juneau-microservice-jetty-template > RestMicroservice
-juneau-microservice-jetty-template.RestMicroservice.Extending =
#juneau-microservice-jetty-template.RestMicroservice.Extending, Overview >
juneau-microservice-jetty-template > RestMicroservice > Extending
RestMicroservice
-juneau-microservice-jetty-template.UiCustomization =
#juneau-microservice-jetty-template.UiCustomization, Overview >
juneau-microservice-jetty-template > UI Customization
juneau-microservice-jetty.Config = #juneau-microservice-jetty.Config, Overview
> juneau-microservice-jetty > Config
juneau-microservice-jetty.Extending = #juneau-microservice-jetty.Extending,
Overview > juneau-microservice-jetty > Extending JettyMicroservice
juneau-microservice-jetty.JettyXml = #juneau-microservice-jetty.JettyXml,
Overview > juneau-microservice-jetty > Jetty.xml file
diff --git a/juneau-doc/src/main/javadoc/resources/fragments/toc.html
b/juneau-doc/src/main/javadoc/resources/fragments/toc.html
index 7ecbb7a..6de8dad 100644
--- a/juneau-doc/src/main/javadoc/resources/fragments/toc.html
+++ b/juneau-doc/src/main/javadoc/resources/fragments/toc.html
@@ -360,30 +360,15 @@
<li><p class='new'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty.UiCustomization'>UI
Customization</a></p>
<li><p class='new'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty.Extending'>Extending
JettyMicroservice</a></p>
</ol>
- <li><p class='toc2 todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template'>juneau-microservice-jetty-template</a></p>
+ <li><p class='toc2 new'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template'>juneau-microservice-jetty-template</a></p>
<ol>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Introduction'>Microservice
Introduction</a></p>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted'>Getting
Started</a></p>
+ <li><p class='updated'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Introduction'>Microservice
Introduction</a></p>
+ <li><p class='updated'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted'>Getting
Started</a></p>
<ol>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Installing'>Installing
in Eclipse</a></p>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Running'>Running
in Eclipse</a></p>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Building'>Building
and Running from Command-Line</a></p>
+ <li><p class='updated'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Installing'>Installing
in Eclipse</a></p>
+ <li><p class='updated'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Running'>Running
in Eclipse</a></p>
+ <li><p class='updated'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.GettingStarted.Building'>Building
and Running from Command-Line</a></p>
</ol>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Manifest'>Manifest
File</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Manifest.ManifestApi'>Manifest
API</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Config'>Config</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.Config.ConfigApi'>Config
File API</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.ResourceClasses'>Resource
Classes</a></p>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.PredefinedResourceClasses'>Predefined
Resource Classes</a></p>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.RestMicroservice'>RestMicroservice</a></p>
- <ol>
- <li><p class=''><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.RestMicroservice.Extending'>Extending
RestMicroservice</a></p>
- </ol>
- <li><p class='todo'><a class='doclink'
href='{OVERVIEW_URL}#juneau-microservice-jetty-template.UiCustomization'>UI
Customization</a></p>
</ol>
<li><p class='toc2 '><a class='doclink'
href='{OVERVIEW_URL}#juneau-examples-core'>juneau-examples-core</a></p>
<ol>
diff --git
a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
b/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
index 13fa48d..9d2a17b 100644
---
a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
+++
b/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
@@ -44,5 +44,4 @@ public class App {
.startConsole()
.join();
}
-
}
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/images/asf.png
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/images/asf.png
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/images/asf.png
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/images/asf.png
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/images/juneau.png
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/images/juneau.png
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/images/juneau.png
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/images/juneau.png
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/styles/SwaggerUI.css
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/styles/SwaggerUI.css
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/styles/SwaggerUI.css
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/styles/SwaggerUI.css
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/dark.css
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/dark.css
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/dark.css
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/dark.css
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/devops.css
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/devops.css
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/devops.css
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/devops.css
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/light.css
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/light.css
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/light.css
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/light.css
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/original.css
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/original.css
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/themes/original.css
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/files/htdocs/themes/original.css
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/jetty.xml
b/juneau-examples/juneau-examples-rest-jetty/src/main/resources/jetty.xml
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/jetty.xml
rename to
juneau-examples/juneau-examples-rest-jetty/src/main/resources/jetty.xml
diff --git a/juneau-microservice/juneau-microservice-jetty-template/.classpath
b/juneau-microservice/juneau-microservice-jetty-template/.classpath
index 8906d38..d623f16 100755
--- a/juneau-microservice/juneau-microservice-jetty-template/.classpath
+++ b/juneau-microservice/juneau-microservice-jetty-template/.classpath
@@ -7,9 +7,8 @@
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/assembly"/>
- <classpathentry kind="src" output="target/test-classes"
path="src/test/java">
+ <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
<attributes>
- <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/.classpath
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/.classpath
index af1430b..4975bcf 100755
---
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/.classpath
+++
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/.classpath
@@ -6,9 +6,8 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" output="target/test-classes"
path="src/test/java">
+ <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
<attributes>
- <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/my-microservice.launch
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/my-microservice.launch
index 2adc719..721de3c 100644
---
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/my-microservice.launch
+++
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/my-microservice.launch
@@ -5,8 +5,7 @@
<booleanAttribute
key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.jetty.JettyMicroservice"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="my-microservice.cfg"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.sample.App"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="my-microservice"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/pom.xml
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/pom.xml
index 4622e03..d1cc3b9 100644
---
a/juneau-microservice/juneau-microservice-jetty-template/build-overlay/pom.xml
+++
b/juneau-microservice/juneau-microservice-jetty-template/build-overlay/pom.xml
@@ -19,7 +19,7 @@
This POM is likewise meant to be used as a starting point for
developers. It creates an uber-jar
to run the microservice from the command line.
- Copy the jar as well as the my-microservice.cfg and jetty.xml file and
start it with:
+ Copy the jar as well as the my-microservice.cfg file and start it with:
java -jar my-microservice-1.0.jar
The group/artifact/version information is meant to be overwritten by
developers to match their own needs.
@@ -35,15 +35,15 @@
<description>My microservice.</description>
<properties>
- <juneau.version>7.1.0-SNAPSHOT</juneau.version>
+ <juneau.version>${project.version}</juneau.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.juneau</groupId>
- <artifactId>juneau-microservice-server</artifactId>
- <version>7.1.0-SNAPSHOT</version>
+ <artifactId>juneau-microservice-jetty</artifactId>
+ <version>${juneau.version}</version>
</dependency>
</dependencies>
@@ -85,12 +85,9 @@
<configuration>
<archive>
<manifest>
-
<mainClass>org.apache.juneau.microservice.jetty.JettyMicroservice
+
<mainClass>org.apache.juneau.microservice.sample.App
</mainClass>
</manifest>
- <manifestEntries>
-
<Main-Config>my-microservice.cfg</Main-Config>
- </manifestEntries>
</archive>
</configuration>
</plugin>
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/my-microservice.cfg
b/juneau-microservice/juneau-microservice-jetty-template/my-microservice.cfg
index 3c010d9..0e65c44 100755
--- a/juneau-microservice/juneau-microservice-jetty-template/my-microservice.cfg
+++ b/juneau-microservice/juneau-microservice-jetty-template/my-microservice.cfg
@@ -16,13 +16,6 @@
# Subprojects can use this as a starting point.
#=======================================================================================================================
-# What to do when the config file is saved.
-# Possible values:
-# NOTHING - Don't do anything. (default)
-# RESTART_SERVER - Restart the Jetty server.
-# RESTART_SERVICE - Shutdown and exit with code '3'.
-saveConfigAction = RESTART_SERVER
-
#=======================================================================================================================
# Jetty settings
#=======================================================================================================================
@@ -40,13 +33,15 @@ resolveVars = true
# jetty.xml file as "$S{availablePort}" (assuming resolveVars is enabled).
port = 10000,0,0,0
-servlets = org.apache.juneau.microservice.sample.RootResources
+# Optionally specify your servlets here:
+#servlets = org.apache.juneau.microservice.sample.RootResources
#=======================================================================================================================
# REST settings
#=======================================================================================================================
[REST]
+# URL mappings to static files in the working directory or classpath.
staticFiles = htdocs:files/htdocs
# Stylesheet to use for HTML views.
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/my-microservice.launch
b/juneau-microservice/juneau-microservice-jetty-template/my-microservice.launch
index b6b5ae4..7b01dd6 100644
---
a/juneau-microservice/juneau-microservice-jetty-template/my-microservice.launch
+++
b/juneau-microservice/juneau-microservice-jetty-template/my-microservice.launch
@@ -1,18 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/juneau-microservice-jetty-template"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN"
value="true"/>
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS"
value="true"/>
<booleanAttribute
key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.jetty.JettyMicroservice"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="my-microservice.cfg"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.apache.juneau.microservice.sample.App"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="juneau-microservice-jetty-template"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
diff --git a/juneau-microservice/juneau-microservice-jetty-template/pom.xml
b/juneau-microservice/juneau-microservice-jetty-template/pom.xml
index b727595..1751afb 100644
--- a/juneau-microservice/juneau-microservice-jetty-template/pom.xml
+++ b/juneau-microservice/juneau-microservice-jetty-template/pom.xml
@@ -68,7 +68,7 @@
<goal>single</goal>
</goals>
<configuration>
-
<finalName>my-microservice-${project.version}</finalName>
+
<finalName>my-microservice-jetty-${project.version}</finalName>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/src/assembly/bin.xml
b/juneau-microservice/juneau-microservice-jetty-template/src/assembly/bin.xml
index 1c4f696..e9467fb 100644
---
a/juneau-microservice/juneau-microservice-jetty-template/src/assembly/bin.xml
+++
b/juneau-microservice/juneau-microservice-jetty-template/src/assembly/bin.xml
@@ -33,11 +33,7 @@
<directory>${basedir}</directory>
<includes>
<include>src/main/**</include>
- <include>src/test/**</include>
<include>.settings/**</include>
- <include>files/**</include>
- <include>META-INF/**</include>
- <include>jetty.xml</include>
<include>my-microservice.cfg</include>
</includes>
</fileSet>
diff --git
a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
b/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/App.java
similarity index 80%
copy from
juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
copy to
juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/App.java
index 13fa48d..062a7e0 100644
---
a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java
+++
b/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/App.java
@@ -10,20 +10,15 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the *
// * specific language governing permissions and limitations under the
License. *
//
***************************************************************************************************************************
-package org.apache.juneau.examples.rest.jetty;
+package org.apache.juneau.microservice.sample;
-import org.apache.juneau.examples.rest.*;
import org.apache.juneau.microservice.jetty.*;
/**
- * An example of an extended REST microservice.
+ * Entry-point for your microservice.
*
* <p>
- * Subclasses can extend from {@link JettyMicroservice} to implement their own
custom behavior.
- * However, this is optional and the {@link JettyMicroservice} class can be
invoked directly.
- *
- * <p>
- * The {@link JettyMicroservice} class will locate the
<code>examples.cfg</code> file in the home directory and initialize
+ * The {@link JettyMicroservice} class will locate the
<code>my-microservice.cfg</code> file in the home directory and initialize
* the resources and commands defined in that file.
*/
public class App {
@@ -44,5 +39,4 @@ public class App {
.startConsole()
.join();
}
-
}
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/RootResources.java
b/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/RootResources.java
index c96b89d..9de1714 100755
---
a/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/RootResources.java
+++
b/juneau-microservice/juneau-microservice-jetty-template/src/main/java/org/apache/juneau/microservice/sample/RootResources.java
@@ -24,7 +24,7 @@ import org.apache.juneau.rest.widget.ThemeMenuItem;
* Root microservice page.
*/
@RestResource(
- path="/",
+ path="/*",
title="My Microservice",
description="Top-level resources page",
htmldoc=@HtmlDoc(
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/images/asf.png
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/images/asf.png
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/images/asf.png
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/images/asf.png
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/images/juneau.png
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/images/juneau.png
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/images/juneau.png
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/images/juneau.png
diff --git
a/juneau-microservice/juneau-microservice-jetty-template/files/htdocs/styles/SwaggerUI.css
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/styles/SwaggerUI.css
similarity index 100%
rename from
juneau-microservice/juneau-microservice-jetty-template/files/htdocs/styles/SwaggerUI.css
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/styles/SwaggerUI.css
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/dark.css
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/dark.css
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/dark.css
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/dark.css
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/devops.css
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/devops.css
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/devops.css
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/devops.css
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/light.css
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/light.css
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/light.css
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/light.css
diff --git
a/juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/original.css
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/original.css
similarity index 100%
rename from
juneau-examples/juneau-examples-rest-jetty/files/htdocs/themes/original.css
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/files/htdocs/themes/original.css
diff --git a/juneau-examples/juneau-examples-rest-jetty/files/jetty.xml
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/jetty.xml
similarity index 94%
rename from juneau-examples/juneau-examples-rest-jetty/files/jetty.xml
rename to
juneau-microservice/juneau-microservice-jetty-template/src/main/resources/jetty.xml
index 9ef28ea..d1ffc81 100644
--- a/juneau-examples/juneau-examples-rest-jetty/files/jetty.xml
+++
b/juneau-microservice/juneau-microservice-jetty-template/src/main/resources/jetty.xml
@@ -32,6 +32,11 @@
<New id="context"
class="org.eclipse.jetty.servlet.ServletContextHandler">
<Set name="contextPath">/</Set>
+ <!-- Optionally specify your servlets here -->
+ <!--Call name="addServlet">
+ <Arg>org.apache.juneau.microservice.sample.RootResources</Arg>
+ <Arg>/*</Arg>
+ </Call-->
<Set name="sessionHandler">
<New
class="org.eclipse.jetty.server.session.SessionHandler" />
</Set>