This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch docs
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/docs by this push:
new d26071631e test: suppress Eclipse/SonarLint warnings on migrated
TODO-160 tail tests
d26071631e is described below
commit d26071631e215d6d82dd2a8ae0ae72c443218772
Author: James Bognar <[email protected]>
AuthorDate: Wed Jun 10 10:19:17 2026 -0400
test: suppress Eclipse/SonarLint warnings on migrated TODO-160 tail tests
---
README.md | 11 +-
pages/developer-info/04.01.Scripts.md | 4 +-
.../04.02.12.ScriptStartExamplesRestJetty.md | 43 --
.../04.02.12.ScriptStartPetstoreJetty.md | 40 ++
.../04.02.13.ScriptStartExamplesRestSpringboot.md | 43 --
.../04.02.13.ScriptStartPetstoreSpringboot.md | 41 ++
pages/release-notes/10.0.0.md | 47 ++
pages/topics/01.01.JuneauEcosystemOverview.md | 4 +-
pages/topics/01.02.Marshalling.md | 2 +-
pages/topics/10.01.JuneauRestServerBasics.md | 2 +-
pages/topics/18.01.JuneauPetstoreBasics.md | 25 --
pages/topics/18.02.JuneauPetstoreRunning.md | 24 --
pages/topics/18.03.JuneauPetstoreApi.md | 198 ---------
pages/topics/18.04.JuneauPetstoreClient.md | 31 --
pages/topics/18.05.JuneauPetstoreServer.md | 310 --------------
pages/topics/19.01.JuneauExamplesCore.md | 5 +-
pages/topics/19.02.JuneauExamplesRest.md | 262 ------------
pages/topics/19.03.JuneauExamplesRestJetty.md | 318 --------------
pages/topics/19.04.JuneauExamplesRestSpringboot.md | 473 ---------------------
pages/topics/JuneauPetstoreOverview.md | 98 +++++
sidebars.ts | 47 +-
src/pages/downloads.md | 3 +-
22 files changed, 245 insertions(+), 1786 deletions(-)
diff --git a/README.md b/README.md
index 7d6c4a6809..12d680b343 100644
--- a/README.md
+++ b/README.md
@@ -38,9 +38,7 @@
* **[Framework
Comparisons](https://juneau.apache.org/docs/topics/FrameworkComparisons)** -
Compare Juneau with Jackson, Spring Boot, and JAX-RS
* **[Examples](https://juneau.apache.org/docs/topics/JuneauExamplesCore)** -
Code examples and tutorials
*
[juneau-examples-core](https://juneau.apache.org/docs/topics/JuneauExamplesCore)
- Core serialization examples
- *
[juneau-examples-rest](https://juneau.apache.org/docs/topics/JuneauExamplesRest)
- REST API examples
- *
[juneau-examples-rest-jetty](https://juneau.apache.org/docs/topics/JuneauExamplesRestJetty)
- Jetty microservice examples
- *
[juneau-examples-rest-springboot](https://juneau.apache.org/docs/topics/JuneauExamplesRestSpringboot)
- Spring Boot examples
+ *
[juneau-petstore](https://juneau.apache.org/docs/topics/JuneauPetstoreOverview)
- Canonical petstore showcase application (deployed under both
Jetty/Microservice and Spring Boot)
* **[Test Reports](https://juneau.apache.org/site/surefire.html)** - JUnit
test execution results
* **[Dependencies](https://juneau.apache.org/site/dependency-info.html)** -
Project dependency analysis
* **[Project Reports](https://juneau.apache.org/site/project-reports.html)** -
Complete Maven site reports
@@ -288,10 +286,9 @@ Apache Juneau™ is a single cohesive Java ecosystem
consisting of the following
* **juneau-microservice** - Microservice API.
* **juneau-microservice-jetty** - Jetty microservice API.
* **juneau-examples-core** - Core code examples.
-* **juneau-examples-rest** - REST code examples.
-* **juneau-examples-rest-jetty** - Jetty microservice examples.
-* **juneau-examples-rest-springboot** - Spring Boot examples.
-* **juneau-petstore** - Complete REST application example.
+* **juneau-petstore-core** - Shared petstore domain + REST resources.
+* **juneau-petstore-jetty** - Jetty/Microservice deployment of the petstore.
+* **juneau-petstore-springboot** - Spring Boot deployment of the petstore.
* **juneau-shaded** - Shaded (uber) JARs combining multiple Juneau modules for
simplified dependency management, especially useful for Bazel builds.
Questions via email to [email protected] are always welcome.
diff --git a/pages/developer-info/04.01.Scripts.md
b/pages/developer-info/04.01.Scripts.md
index 53a38a7535..3594a0f4b1 100644
--- a/pages/developer-info/04.01.Scripts.md
+++ b/pages/developer-info/04.01.Scripts.md
@@ -26,8 +26,8 @@ These scripts are located in the `master` branch and are used
for code developme
|
[check-fluent-setter-overrides.py](/docs/developer-info/04.02.09.ScriptCheckFluentSetterOverrides)
| Check fluent setter overrides | [Learn more
→](/docs/developer-info/04.02.09.ScriptCheckFluentSetterOverrides) |
| [revert-staged.py](/docs/developer-info/04.02.10.ScriptRevertStaged) |
Revert staged git changes | [Learn more
→](/docs/developer-info/04.02.10.ScriptRevertStaged) |
| [revert-unstaged.py](/docs/developer-info/04.02.11.ScriptRevertUnstaged) |
Revert unstaged git changes | [Learn more
→](/docs/developer-info/04.02.11.ScriptRevertUnstaged) |
-|
[start-examples-rest-jetty.py](/docs/developer-info/04.02.12.ScriptStartExamplesRestJetty)
| Start REST examples with Jetty | [Learn more
→](/docs/developer-info/04.02.12.ScriptStartExamplesRestJetty) |
-|
[start-examples-rest-springboot.py](/docs/developer-info/04.02.13.ScriptStartExamplesRestSpringboot)
| Start REST examples with Spring Boot | [Learn more
→](/docs/developer-info/04.02.13.ScriptStartExamplesRestSpringboot) |
+| [start-petstore-jetty.py](/docs/developer-info/ScriptStartPetstoreJetty) |
Start the petstore showcase under Jetty/Microservice | [Learn more
→](/docs/developer-info/ScriptStartPetstoreJetty) |
+|
[start-petstore-springboot.py](/docs/developer-info/ScriptStartPetstoreSpringboot)
| Start the petstore showcase under Spring Boot | [Learn more
→](/docs/developer-info/ScriptStartPetstoreSpringboot) |
### 4.3. Doc Scripts (docs branch)
diff --git a/pages/developer-info/04.02.12.ScriptStartExamplesRestJetty.md
b/pages/developer-info/04.02.12.ScriptStartExamplesRestJetty.md
deleted file mode 100644
index 139d292a35..0000000000
--- a/pages/developer-info/04.02.12.ScriptStartExamplesRestJetty.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: "start-examples-rest-jetty.py"
-slug: ScriptStartExamplesRestJetty
----
-
-`start-examples-rest-jetty.py` starts the Juneau REST examples application
using the embedded Jetty server. This provides a live demonstration of Juneau's
REST capabilities.
-
-## What It Does
-
-The script performs these operations:
-
-1. **Locates Project** - Finds the Juneau project root directory
-2. **Checks Build** - Verifies that classes are compiled
-3. **Auto-Builds** - Runs `mvn clean compile` if classes are missing
-4. **Starts Server** - Launches the Jetty-based REST examples application
-5. **Handles Shutdown** - Gracefully stops the server on Ctrl+C
-
-## Usage
-
-### Start the Server
-
-```bash
-cd /Users/james.bognar/git/juneau
-python3 scripts/start-examples-rest-jetty.py
-```
-
-The server will start at `http://localhost:10000/`
-
-Press `Ctrl+C` to stop the server.
-
-## Requirements
-
-- Python 3.6 or higher
-- Maven (mvn command must be in PATH)
-- Java 17+
-- No external Python dependencies (uses only standard library)
-
-## Notes
-
-- The script automatically builds the project if needed
-- The server runs in the foreground
-- Swagger UI is typically available at `http://localhost:10000/swagger-ui`
-
diff --git a/pages/developer-info/04.02.12.ScriptStartPetstoreJetty.md
b/pages/developer-info/04.02.12.ScriptStartPetstoreJetty.md
new file mode 100644
index 0000000000..72d5707d8f
--- /dev/null
+++ b/pages/developer-info/04.02.12.ScriptStartPetstoreJetty.md
@@ -0,0 +1,40 @@
+---
+title: "start-petstore-jetty.py"
+slug: ScriptStartPetstoreJetty
+---
+
+`start-petstore-jetty.py` starts the Juneau petstore sample application using
the embedded Jetty/Microservice container. It is a convenience launcher
equivalent to running the `org.apache.juneau.petstore.jetty.App` main class via
Maven's `exec` plugin.
+
+## What It Does
+
+The script:
+1. Locates the project root from its own filesystem position.
+2. Confirms `juneau-petstore/juneau-petstore-jetty/target/classes` exists; if
not, runs `mvn clean compile` first.
+3. Invokes `mvn exec:java
-Dexec.mainClass=org.apache.juneau.petstore.jetty.App` from the petstore-jetty
module directory.
+
+## Usage
+
+```bash
+python3 scripts/start-petstore-jetty.py
+```
+
+The petstore boots on `http://localhost:10000` by default (configurable via
`juneau-petstore-jetty.cfg`'s `[Jetty]/port`). The microservice console is
enabled — type `help` for available commands or `exit` to stop.
+
+## Useful URLs once running
+
+- `GET http://localhost:10000/petstore/pets` — full pet listing.
+- `GET http://localhost:10000/petstore/pets/1` — single seeded pet (`Mr.
Frisky`).
+- `GET http://localhost:10000/pet-views/mustache/pets/1/view` —
Mustache-rendered pet detail page.
+- `GET http://localhost:10000/petstore-ui/static/petstore-ui.html` — React SPA
demo.
+- `GET http://localhost:10000/petstore-secure/pets` (with `Authorization:
Bearer petstore-user`) — bearer-token-gated CRUD.
+
+## Requirements
+
+- Python 3.6 or higher
+- Maven (must be on PATH)
+- Java 17+
+
+## Related
+
+- See [juneau-petstore Overview](/docs/topics/JuneauPetstoreOverview) for the
application architecture.
+- See
[start-petstore-springboot.py](/docs/developer-info/ScriptStartPetstoreSpringboot)
for the Spring Boot variant.
diff --git a/pages/developer-info/04.02.13.ScriptStartExamplesRestSpringboot.md
b/pages/developer-info/04.02.13.ScriptStartExamplesRestSpringboot.md
deleted file mode 100644
index a6a23462ca..0000000000
--- a/pages/developer-info/04.02.13.ScriptStartExamplesRestSpringboot.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: "start-examples-rest-springboot.py"
-slug: ScriptStartExamplesRestSpringboot
----
-
-`start-examples-rest-springboot.py` starts the Juneau REST examples
application using Spring Boot. This demonstrates how Juneau integrates with the
Spring Boot framework.
-
-## What It Does
-
-The script performs these operations:
-
-1. **Locates Project** - Finds the Juneau project root directory
-2. **Checks Build** - Verifies that classes are compiled
-3. **Auto-Builds** - Runs `mvn clean compile` if classes are missing
-4. **Starts Server** - Launches the Spring Boot REST examples application
-5. **Handles Shutdown** - Gracefully stops the server on Ctrl+C
-
-## Usage
-
-### Start the Server
-
-```bash
-cd /Users/james.bognar/git/juneau
-python3 scripts/start-examples-rest-springboot.py
-```
-
-The server will start at `http://localhost:5000/`
-
-Press `Ctrl+C` to stop the server.
-
-## Requirements
-
-- Python 3.6 or higher
-- Maven (mvn command must be in PATH)
-- Java 17+
-- No external Python dependencies (uses only standard library)
-
-## Notes
-
-- The script automatically builds the project if needed
-- The server runs in the foreground
-- Swagger UI is typically available at `http://localhost:5000/swagger-ui`
-
diff --git a/pages/developer-info/04.02.13.ScriptStartPetstoreSpringboot.md
b/pages/developer-info/04.02.13.ScriptStartPetstoreSpringboot.md
new file mode 100644
index 0000000000..7fb5dd7269
--- /dev/null
+++ b/pages/developer-info/04.02.13.ScriptStartPetstoreSpringboot.md
@@ -0,0 +1,41 @@
+---
+title: "start-petstore-springboot.py"
+slug: ScriptStartPetstoreSpringboot
+---
+
+`start-petstore-springboot.py` starts the Juneau petstore sample application
using Spring Boot's embedded servlet container. It is a convenience launcher
equivalent to running `mvn spring-boot:run` from the petstore-springboot module.
+
+## What It Does
+
+The script:
+1. Locates the project root from its own filesystem position.
+2. Confirms `juneau-petstore/juneau-petstore-springboot/target/classes`
exists; if not, runs `mvn clean compile` first.
+3. Invokes `mvn spring-boot:run` from the petstore-springboot module directory.
+
+## Usage
+
+```bash
+python3 scripts/start-petstore-springboot.py
+```
+
+The petstore boots on `http://localhost:5000` by default (configurable via
`application.properties`'s `server.port` or the `PORT` environment variable).
+
+## Useful URLs once running
+
+- `GET http://localhost:5000/petstore/pets` — full pet listing.
+- `GET http://localhost:5000/petstore/pets/1` — single seeded pet (`Mr.
Frisky`).
+- `GET http://localhost:5000/pet-views/mustache/pets/1/view` —
Mustache-rendered pet detail page.
+- `GET http://localhost:5000/petstore-ui/static/petstore-ui.html` — React SPA
demo.
+- `GET http://localhost:5000/petstore-secure/pets` (with `Authorization:
Bearer petstore-user`) — bearer-token-gated CRUD.
+- `GET http://localhost:5000/hello` — Spring `@Autowired` injection demo
(deployment-specific).
+
+## Requirements
+
+- Python 3.6 or higher
+- Maven (must be on PATH)
+- Java 17+
+
+## Related
+
+- See [juneau-petstore Overview](/docs/topics/JuneauPetstoreOverview) for the
application architecture.
+- See [start-petstore-jetty.py](/docs/developer-info/ScriptStartPetstoreJetty)
for the Jetty/Microservice variant.
diff --git a/pages/release-notes/10.0.0.md b/pages/release-notes/10.0.0.md
index 355a8e8a7b..8dfac36b13 100644
--- a/pages/release-notes/10.0.0.md
+++ b/pages/release-notes/10.0.0.md
@@ -61,6 +61,52 @@ The `JettyMicroservice.run(...)` facade has three overloads:
The legacy `juneau-my-jetty-microservice` template module has been removed
from the reactor. Consumers should migrate to the new `JettyMicroservice`
facade in `juneau-microservice-jetty` — it delivers the same zero-config
developer experience without requiring the consumer to copy a template project.
+### juneau-petstore (new module family)
+
+Three new modules under a top-level `juneau-petstore/` aggregator together
form the canonical Juneau petstore showcase application. The legacy
`juneau-examples-rest{,-jetty,-springboot,-jetty-ftest}` family of modules has
been retired in this release in favor of the petstore family — see the
**Breaking Changes** section below.
+
+#### `juneau-petstore-core`
+
+Shared, deployment-agnostic surface consumed verbatim by both the Jetty and
Spring Boot deployments. Owns:
+
+- **Domain beans** — `Pet`, `Order`, `User` (plus
`Species`/`PetStatus`/`OrderStatus`/`UserStatus` enums) under
`org.apache.juneau.petstore.dto`. Plain Juneau beans, no JPA/Hibernate/Derby.
+- **In-memory `PetStore` service** — `ConcurrentHashMap`-backed, lazy-loads
classpath seed JSON at `petstore/init/{Pets,Orders,Users}.json` via
`Json5Parser`. Auto-IDs via `AtomicLong`.
+- **`PetStoreResource`** — full CRUD `@Rest` servlet
(`GET`/`POST`/`PUT`/`DELETE` over `/pets`, `/orders`, `/users`). Uses
`org.apache.juneau.http.response.NotFound` (next-gen) and
`@org.apache.juneau.http.Path`/`@Content`. Spring-agnostic — extends
`BasicRestServlet` so both deployments mount it identically.
+- **View-engine demos** — `PetMustacheViewResource` and
`PetFreemarkerViewResource` demonstrate the typed-`View` return path through
the `juneau-rest-server-view-{mustache,freemarker}` bridges. Templates ship at
`petstore-templates/pet.{mustache,ftlh}`. Pure-classpath engines so both
deployments inherit view rendering at parity.
+- **No-build React SPA demo** — `PetstoreUiResource` mounts `StaticFilesMixin`
to serve `htdocs/petstore-ui.html`, a single-page React UI that calls
`/petstore/pets` over `fetch()`. Demonstrates the headless-JSON + decoupled-SPA
pattern alongside the server-rendered HTML-doc UI; no Node/npm in the build
(loads React from CDN as a v1 placeholder; production should vendor with
appropriate NOTICE/LICENSE).
+- **`PetSecureResource` + `StubBearerTokenValidator`** — auth-gated CRUD
subset under `/petstore-secure/*`, gated by a `BearerTokenGuard` (fail-closed,
op-level) backed by the in-memory stub validator. Demonstrates the bearer-token
+ `@Auth Principal` pattern; resource-Javadoc cross-references
`AuthFilterChain` for multi-mechanism deployments.
+
+#### `juneau-petstore-jetty`
+
+Jetty/`Microservice` deployment glue:
+
+- `App.main` calls
`Microservice.create().configurations(JettyConfiguration.class,
AppConfig.class)...`.
+- `RootResources extends BasicRestServletGroup` — mounts every core child
resource plus the Jetty-only `Microservice` admin trio
(`ConfigResource`/`LogsResource`/`ShutdownResource`).
+- Bundled `jetty.xml` and `juneau-petstore-jetty.cfg`.
+- Starter-zip assembly — sources + cfg + `jetty.xml` for IDE-import use.
+- In-module integration tests (`@JettyMicroserviceTest`, ephemeral port).
+- Default URL: `http://localhost:10000`.
+
+Launcher: `python3 scripts/start-petstore-jetty.py`.
+
+#### `juneau-petstore-springboot`
+
+Spring Boot deployment glue:
+
+- `App` is a `@SpringBootApplication` with `@Bean RootResources` + `@Bean
ServletRegistrationBean<Servlet>` mounted at `/*`.
+- `RootResources extends BasicSpringRestServletGroup` so child resources
resolve as Spring beans (required for `HelloResource`'s `@Autowired
HelloMessageProvider` injection demo).
+- Inherits `${spring.version}` from the repo parent.
+- `application.properties` configures port 5000.
+- `spring-boot-maven-plugin repackage` produces a runnable fat jar.
+- `@SpringBootTest(webEnvironment=RANDOM_PORT)` integration tests.
+- Default URL: `http://localhost:5000`.
+
+Launcher: `python3 scripts/start-petstore-springboot.py`.
+
+#### Parity story
+
+The core-hosted surface (CRUD, view demos, React SPA demo, auth-gated subset)
is identical across both deployments by construction — it's shared code, not
parallel copies. The deployment-specific surface (Jetty's microservice console
+ admin resources vs Spring Boot's `@Autowired` injection demo) is
intentionally non-parity and documented as such.
+
### Bug Fixes
_TBD — to be filled in as development continues._
@@ -68,6 +114,7 @@ _TBD — to be filled in as development continues._
### Breaking Changes
- **`juneau-my-jetty-microservice` removed.** The template-project module has
been retired in favor of the new `JettyMicroservice` facade + bundled defaults
in `juneau-microservice-jetty`. See the New Features section above for
migration guidance.
+- **`juneau-examples-rest{,-jetty,-springboot,-jetty-ftest}` removed.** The
four-module legacy example family has been retired in favor of the new
`juneau-petstore-{core,jetty,springboot}` showcase family. The legacy modules
carried an unpatched Hibernate ORM 5.6.x SQL-injection vulnerability
(CVE-2026-0603) that had no upstream fix because Hibernate 5.6.x is
end-of-life; deletion closes that exposure surface. The accompanying
`scripts/start-examples-rest-jetty.py` and `scripts/start-exa [...]
_Other entries TBD — to be filled in before release. See also the major
version bump note above._
diff --git a/pages/topics/01.01.JuneauEcosystemOverview.md
b/pages/topics/01.01.JuneauEcosystemOverview.md
index 851f777dc3..c4d171c7ba 100644
--- a/pages/topics/01.01.JuneauEcosystemOverview.md
+++ b/pages/topics/01.01.JuneauEcosystemOverview.md
@@ -29,8 +29,8 @@ The Juneau ecosystem consists of the following parts:
| |
[juneau‑rest‑server‑springboot](/docs/topics/JuneauRestServerSpringbootBasics)
| REST Spring Boot integration | • Spring Boot 2.0+ |
| **juneau-microservice** |
[juneau‑microservice](/docs/topics/JuneauMicroserviceBasics) | Microservice
functionality | • *None* |
| | [juneau‑microservice‑jetty](/docs/topics/JuneauMicroserviceJettyBasics) |
Jetty-based microservice implementation | • Jetty 9.4+ |
-| **juneau-petstore** | [juneau‑petstore](/docs/topics/JuneauPetstoreBasics) |
Complete REST application example | • Spring Boot 2.0+ |
-| **juneau-examples** |
[juneau‑examples‑core](/docs/topics/JuneauExamplesCore)<br/>[juneau‑examples‑rest](/docs/topics/JuneauExamplesRest)<br/>[juneau‑examples‑rest‑jetty](/docs/topics/JuneauExamplesRestJetty)<br/>[juneau‑examples‑rest‑springboot](/docs/topics/JuneauExamplesRestSpringboot)
| Code examples and tutorials | |
+| **juneau-petstore** | [juneau‑petstore](/docs/topics/JuneauPetstoreOverview)
| Complete petstore showcase application — `juneau‑petstore‑core` shared
surface plus `‑jetty` (Microservice) and `‑springboot` deployments | • Servlet
3.1+<br/>• Spring Boot 4.x (springboot deployment only) |
+| **juneau-examples** |
[juneau‑examples‑core](/docs/topics/JuneauExamplesCore) | Code examples and
tutorials | |
| **juneau-shaded** | [juneau‑shaded‑all](/docs/topics/JuneauShadedAll) |
Complete framework in one JAR (4.0 MB)<br/>*Ideal for Bazel and simplified
dependency management* | • Servlet API 6.1+<br/>• Apache HttpClient 5.x |
| | [juneau‑shaded‑core](/docs/topics/JuneauShadedCore) | Core marshalling and
configuration in one JAR (2.0 MB) | • *None* |
| | [juneau‑shaded‑rest‑client](/docs/topics/JuneauShadedRestClient) | Core +
REST client functionality (3.8 MB) | • Apache HttpClient 5.x |
diff --git a/pages/topics/01.02.Marshalling.md
b/pages/topics/01.02.Marshalling.md
index cfd3e9513b..ae28050d08 100644
--- a/pages/topics/01.02.Marshalling.md
+++ b/pages/topics/01.02.Marshalling.md
@@ -125,7 +125,7 @@ supported for marshalling a POJO to and from a string.
:::info See Also
-- [juneau-examples-rest](/docs/topics/JuneauRestServerBasics) for more
information.
+- [juneau-rest-server Basics](/docs/topics/JuneauRestServerBasics) for more
information.
:::
diff --git a/pages/topics/10.01.JuneauRestServerBasics.md
b/pages/topics/10.01.JuneauRestServerBasics.md
index 30c25f3dbc..66fba845f4 100644
--- a/pages/topics/10.01.JuneauRestServerBasics.md
+++ b/pages/topics/10.01.JuneauRestServerBasics.md
@@ -93,4 +93,4 @@ It also means you need nothing more than a Servlet container
such as Jetty to us
Typically useful for performing conversions on input and output, such as for
supporting older input and output
formats.
-Many of the examples in this document are pulled directly from
[juneau-examples-rest](/docs/topics/JuneauRestServerBasics).
+Many of the examples in this document are pulled directly from the
[juneau-petstore](/docs/topics/JuneauPetstoreOverview) showcase application.
diff --git a/pages/topics/18.01.JuneauPetstoreBasics.md
b/pages/topics/18.01.JuneauPetstoreBasics.md
deleted file mode 100644
index c49c009e85..0000000000
--- a/pages/topics/18.01.JuneauPetstoreBasics.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: "juneau-petstore Basics"
-slug: JuneauPetstoreBasics
----
-
-The
[PetStore](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/PetStore.java)
application is an functional application meant to demonstrate using Juneau
with Spring Boot to create an
-end-to-end client/server REST API.
-
-What makes Juneau unique is the ability to create Java interfaces that behave
just like RPC but using REST as the
-underlying protocol.
-
-And the technology it not tied to any platform so it can be used in any
environment by simply pulling in Maven
-dependencies.
-
-The server-side need only provide the ability to host a servlet.
-
-Visit the [GitHub project](https://github.com/apache/juneau-petstore) hosting
the application.
-
-The project is broken down into the following subprojects:
-
-<tree>
-<node-0><java-project><a
href="https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-api"
target="_blank">juneau-petstore-api</a></java-project> - Contains the Java
interface and DTO beans for the petstore application.</node-0>
-<node-0><java-project><a
href="https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-server"
target="_blank">juneau-petstore-server</a></java-project> - Contains the
server-side Java implementation of the petstore Java interface as a REST
resource.</node-0>
-<node-0><java-project><a
href="https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-client"
target="_blank">juneau-petstore-client</a></java-project> - Contains the
client-side Java proxy of the petstore Java interface.</node-0>
-</tree>
\ No newline at end of file
diff --git a/pages/topics/18.02.JuneauPetstoreRunning.md
b/pages/topics/18.02.JuneauPetstoreRunning.md
deleted file mode 100644
index 6254d48232..0000000000
--- a/pages/topics/18.02.JuneauPetstoreRunning.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Running the Pet Store App"
-slug: JuneauPetstoreRunning
----
-
-The Pet Store app is a Spring Boot application that can be started up by
running the
[App](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/server/App.java)
class.
-
-This starts the application on port 5000.
-
-It can also be started in a docker container using the following instructions:
-
-- Install docker on your machine.
-
-- Clone the Petstore project on your machine.
-
-```bash
-git clone https://github.com/apache/juneau-petstore.git
-```
-
-- Open terminal inside the project directory and run the below command to
start the app.
-
-```bash
-docker build . -t petstore && docker run -p 5000:5000 petstore
-```
diff --git a/pages/topics/18.03.JuneauPetstoreApi.md
b/pages/topics/18.03.JuneauPetstoreApi.md
deleted file mode 100644
index fa9c09adae..0000000000
--- a/pages/topics/18.03.JuneauPetstoreApi.md
+++ /dev/null
@@ -1,198 +0,0 @@
----
-title: "juneau-petstore-api"
-slug: JuneauPetstoreApi
----
-
-The
[juneau-petstore-api](https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-api)
module contains the Java interface of our application and the DTO beans that
go along with it.
-
-These classes are meant to be shared between the server and client side code.
-
-The
[PetStore](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/PetStore.java)
class is our primary class for defining our application.
-
-It's a standard Java interface with annotations used to describe how the
methods map to REST calls.
-
-####
[PetStore.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/PetStore.java)
-
-```java
-@Remote(path="/petstore")
-public interface PetStore {
-
-
//------------------------------------------------------------------------------------------------------------------
- // Pets
-
//------------------------------------------------------------------------------------------------------------------
-
- /**
- * Returns all pets in the database.
- *
- * @return All pets in the database.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- */
- @RemoteGet("/pet")
- public Collection<Pet> getPets() throws NotAcceptable;
-
- /**
- * Returns a pet from the database.
- *
- * @param petId The ID of the pet to retrieve.
- * @return The pet.
- * @throws IdNotFound Pet was not found.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- */
- @RemoteGet("/pet/{petId}")
- public Pet getPet(
- name="petId",
- schema=@Schema(description="ID of pet to return")
- ) long petId
- ) throws IdNotFound, NotAcceptable;
-
- /**
- * Adds a pet to the database.
- *
- * @param pet The pet data to add to the database.
- * @return Ok if successful.
- * @throws IdConflict ID already in use.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- * @throws UnsupportedMediaType Unsupported `Content-Type` header
specified.
- */
- @RemotePost("/pet")
- public long createPet(
- @Content(
- schema=@Schema(description="Pet object to add to the store")
- ) CreatePet pet
- ) throws IdConflict, NotAcceptable, UnsupportedMediaType;
-
- /**
- * Updates a pet in the database.
- *
- * @param pet The pet data to add to the database.
- * @return Ok if successful.
- * @throws IdNotFound ID not found.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- * @throws UnsupportedMediaType Unsupported `Content-Type` header
specified.
- */
- @RemotePut("/pet/{petId}")
- public Ok updatePet(
- @Content(
- schema=@Schema(description="Pet object that needs to be added to
the store")
- ) UpdatePet pet
- ) throws IdNotFound, NotAcceptable, UnsupportedMediaType;
-
- /**
- * Find all pets with the matching statuses.
- *
- * @param status The statuses to match against.
- * @return The pets that match the specified statuses.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- */
- @RemoteGet("/pet/findByStatus")
- public Collection<Pet> findPetsByStatus(
- @Query(
- name="status",
- schema=@Schema(
- description="Status values that need to be considered for
filter.",
- required=true,
- type="array",
- collectionFormat="csv",
- items=@Items(
- type="string",
- _enum="AVAILABLE,PENDING,SOLD",
- _default="AVAILABLE"
- )
- )
- ) PetStatus[] status
- ) throws NotAcceptable;
-
- /**
- * Deletes the specified pet.
- *
- * @param apiKey Security key.
- * @param petId ID of pet to delete.
- * @return Ok if successful.
- * @throws IdNotFound Pet not found.
- * @throws NotAcceptable Unsupported `Accept` header specified.
- */
- @RemoteDelete("/pet/{petId}")
- public Ok deletePet(
- @Header(
- name="api_key",
- schema=@Schema(
- description="Security API key",
- required=true
- )
- ) String apiKey,
- @Path(
- name="petId",
- schema=@Schema(description="Pet id to delete")
- ) long petId
- ) throws IdNotFound, NotAcceptable;
-
- /**
- * Deletes all pets in the database.
- *
- * @return Ok if successful.
- */
- @RemoteDelete("/pet")
- public Ok deleteAllPets();
-
-
//------------------------------------------------------------------------------------------------------------------
- // Orders
-
//------------------------------------------------------------------------------------------------------------------
-
- // ... (additional order methods would go here)
-}
-```
-
-`@Remote` and `@RemoteX` are client-side annotations used to map the method
calls to REST and will be describe in the
-client code section.
-
-`@Path` and `@Body` are used by both the client and server side code to map to
REST artifacts on both sides.
-
-Both sets of annotations are provided by pulling in the Juneau dependency
below:
-
-#### Maven Dependency
-
-```xml
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-marshall</artifactId>
- <version>9.x.x</version>
-</dependency>
-```
-
-The
[Pet](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java)
class is a DTO bean that gets serialized over the REST connection.
-
-It is also annotated with JPA annotations so that they can easily be stored in
a JPA datastore on the server side.
-
-####
[Pet.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java)
-
-```java
-@Marshalled(typeName="Pet")
-@BeanType(properties="id,species,name,tags,price,status")
-@Entity(name="PetstorePet")
-public class Pet {
-
- @Column @Id @GeneratedValue
- @Schema(description="Unique identifier for this pet.")
- @Html(link="servlet:/pet/{id}")
- private long id;
-
- @Column(length=50)
- Schema(description="Pet name.", minLength=3, maxLength=50)
- private String name;
-
- @Column
- @Schema(description="Price of pet.", maximum="999.99")
- @Html(render=PriceRender.class)
- private float price;
-
- // ... (additional fields and methods would go here)
-}
-```
-
-The annotations here are a combination of Juneau annotations for controlling
marshalling (`@Marshalled`, `@BeanType`, `@Html`) and
-documentation/validation (`@Schema`), and JPA annotations for database
persistence (`@Entity`, `@Column`).
-
-Most applications may choose to have separate classes for DTO beans and JPA
beans since you typically are not going to want
-to expose server-side details to client-side code.
-
-In these examples however they were combined into the same classes for brevity.
\ No newline at end of file
diff --git a/pages/topics/18.04.JuneauPetstoreClient.md
b/pages/topics/18.04.JuneauPetstoreClient.md
deleted file mode 100644
index 6e19551332..0000000000
--- a/pages/topics/18.04.JuneauPetstoreClient.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-title: "juneau-petstore-client"
-slug: JuneauPetstoreClient
----
-
-The
[juneau-petstore-client](https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-client)
module contains a single
[Main](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-client/src/main/java/org/apache/juneau/petstore/client/Main.java)
class used to instantiate the proxy against our remote REST
-interface using the Java interface described above.
-
-####
[Main.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-client/src/main/java/org/apache/juneau/petstore/client/Main.java)
-
-```java
-public class Main {
-
- public static void main(String[] args) {
-
- // Create a RestClient with JSON serialization support.
- RestClient restClient = RestClient.create().json5().build();
-
- // Instantiate our proxy.
- PetStore petStore = restClient.getRemote(PetStore.class,
"http://localhost:5000");
-
- // Print out the pets in the store.
- Collection<Pet> pets = petStore.getPets();
-
- // Pretty-print them to STDOUT.
- Json5.DEFAULT_READABLE.println(pets);
- }
-}
-```
-
-Notice how little code is necessary to construct a remote proxy.
\ No newline at end of file
diff --git a/pages/topics/18.05.JuneauPetstoreServer.md
b/pages/topics/18.05.JuneauPetstoreServer.md
deleted file mode 100644
index 36b3cbf99c..0000000000
--- a/pages/topics/18.05.JuneauPetstoreServer.md
+++ /dev/null
@@ -1,310 +0,0 @@
----
-title: "juneau-petstore-server"
-slug: JuneauPetstoreServer
----
-
-The
[juneau-petstore-server](https://github.com/apache/juneau-petstore/tree/master/juneau-petstore-server)
module contains all of the guts of the application.
-It's a standard Spring Boot application with Juneau integration support.
-
-For brevity, the app and configuration classes are combined into the following
[App](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/server/App.java)
class:
-
-####
[App.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/server/App.java)
-
-```java
-@SpringBootApplication
-@EnableJpaRepositories(basePackages="org.apache.juneau.petstore")
-@EnableCaching
-@Controller
-public class App {
-
-
//-----------------------------------------------------------------------------------------------------------------
- // App
-
//-----------------------------------------------------------------------------------------------------------------
-
- public static void main(String[] args) {
- try {
- new SpringApplicationBuilder(App.class).run(args);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-
//-----------------------------------------------------------------------------------------------------------------
- // Beans
-
//-----------------------------------------------------------------------------------------------------------------
-
- @Bean
- public PetStoreService petStoreService() {
- return new PetStoreService();
- }
-
- @Bean
- public RootResources rootResources() {
- return new RootResources();
- }
-
- @Bean
- public PetStoreResource petStoreResource() {
- return new PetStoreResource();
- }
-
- @Bean
- public ServletRegistrationBean<RootResources> getRootServlet(RootResources
rootResources) {
- return new ServletRegistrationBean<>(rootResources, "/*");
- }
-}
-```
-
-Notice how cleanly Juneau servlets fit into Spring Boot.
-No special initializers are required to integrate Juneau with Spring Boot.
-
-The
[RootResources](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/RootResources.java)
class is the top-level entry point into the REST API.
-It allows us to group child resources.
-In our case though we only have one child
resource...[PetStoreResource](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java):
-
-####
[RootResources.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/RootResources.java)
-
-```java
-@Rest(
- path="/*",
- title="Root resources",
- description="Example of a router resource page.",
- children={
- PetStoreResource.class
- }
-)
-@HtmlDocConfig(
- widgets={
- ContentTypeMenuItem.class
- },
- navlinks={
- "options: ?method=OPTIONS",
- "$W{ContentTypeMenuItem}",
- "source:
$C{Source/gitHub}/org/apache/juneau/petstore/rest/$R{servletClassSimple}.java"
- },
- aside={
- "",
- " This is an example of a 'router' page that serves as a jumping-off
point to child resources.",
- " Resources can be nested arbitrarily deep through router pages.",
- " Note the options link provided that lets you see the generated
swagger doc for this page.",
- " Also note the sources link on these pages to view the source code
for the page.",
- " All content on pages in the UI are serialized POJOs.",
- " In this case, it's a serialized array of beans with 2 properties,
'name' and 'description'.",
- " Other features (such as this aside) are added through annotations.",
- ""
- }
-)
-public class RootResources extends BasicSpringRestServletGroup {
- private static final long serialVersionUID = 1L;
-}
-```
-
-By extending from `BasicSpringRestServletGroup`, the root servlet hooks into
the injection framework of Spring
-to resolve spring beans such as the child resource
[PetStoreResource](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java).
-
-This page renders as follows: `http://localhost:5000`
-
-The
[PetStoreResource](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java)
class is the REST implementation of our
[PetStore](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/PetStore.java)
interface.
-
-####
[PetStoreResource.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java)
-
-```java
-@Rest(
- path="/petstore",
- title="Petstore application",
- description={
- "This is a sample server Petstore server based on the Petstore sample
at Swagger.io.",
- "You can find out more about Swagger at http://swagger.io.",
- },
- swagger=@Swagger(
- version="1.0.0",
- title="Swagger Petstore",
- termsOfService="You are on your own.",
- contact=@Contact(
- name="Juneau Development Team",
- email="[email protected]",
- url="http://juneau.apache.org"
- ),
- license=@License(
- name="Apache 2.0",
- url="http://www.apache.org/licenses/LICENSE-2.0.html"
- ),
- externalDocs=@ExternalDocs(
- description="Find out more about Juneau",
- url="http://juneau.apache.org"
- ),
- tags={
- @Tag(
- name="pet",
- description="Everything about your Pets",
- externalDocs=@ExternalDocs(
- description="Find out more",
- url="http://juneau.apache.org"
- )
- ),
- @Tag(
- name="store",
- description="Access to Petstore orders"
- ),
- @Tag(
- name="user",
- description="Operations about user",
- externalDocs=@ExternalDocs(
- description="Find out more about our store",
- url="http://juneau.apache.org"
- )
- )
- }
- ),
- staticFiles={"htdocs:/htdocs"}
-)
-@HtmlDocConfig(
- widgets={
- ContentTypeMenuItem.class,
- },
- navlinks={
- "up: request:/..",
- "options: servlet:/?method=OPTIONS",
- "$W{ContentTypeMenuItem}",
- "source:
$C{Source/gitHub}/org/apache/juneau/petstore/rest/$R{servletClassSimple}.java"
- },
- head={
- "<link rel='icon' href='$U{servlet:/htdocs/cat.png}'/>", // Add a cat
icon to the page.
- },
- header={
- "# $R{resourceTitle}",
- "## $R{methodSummary}",
- "$C{PetStore/headerImage}"
- },
- aside={
- "",
- " This page shows a standard nested REST resource.",
- " It shows how different properties can be rendered on the same bean
in different views.",
- " It also shows examples of HtmlRender classes and
@BeanProperty(format) annotations.",
- " It also shows how the Queryable converter and query widget can be
used to create searchable interfaces.",
- ""
- },
- stylesheet="servlet:/htdocs/themes/dark.css" // Use dark theme by default.
-)
-public class PetStoreResource extends BasicRestObject implements PetStore {
-
- @Autowired private PetStoreService store;
-
- /**
- * Navigation page
- *
- * @return Navigation page contents.
- */
- @RestGet(
- path="/",
- summary="Navigation page"
- )
- @HtmlDocConfig(
- style={
- "INHERIT", // Flag for inheriting resource-level CSS.
- "body { ",
- "background-image: url('petstore/htdocs/background.jpg'); ",
- "background-color: black; ",
- "background-size: cover; ",
- "background-attachment: fixed; ",
- "}"
- }
- )
- public ResourceDescriptions getTopPage() {
- return new ResourceDescriptions()
- .append("pet", "All pets in the store")
- .append("store", "Orders and inventory")
- .append("user", "Petstore users")
- ;
- }
-
- ...
-```
-
-Clicking the `petstore` link on the root page takes you to our PetStore
resource: `http://localhost:5000/petstore`
-
-The methods defined in our
[PetStore](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/PetStore.java)
interface are implemented like so:
-
-####
[PetStoreResource.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java)
-
-```java
-@Override /* PetStore */
-@RestGet(
- path="/pet",
- summary="All pets in the store",
- swagger=@OpSwagger(
- tags="pet",
- parameters={
- Queryable.SWAGGER_PARAMS // Documents searching.
- }
- ),
- converters={Queryable.class} // Searching support.
-)
-@BeanTypeApply(on="Pet", value=@BeanType(excludeProperties="tags,photo")) //
In this view, don't serialize tags/photos properties.
-public Collection<Pet> getPets() throws NotAcceptable {
- return store.getPets();
-}
-
-@Override /* PetStore */
-@RestGet(
- path="/pet/{petId}",
- summary="Find pet by ID",
- description="Returns a single pet",
- swagger=@OpSwagger(
- tags="pet"
- )
-)
-public Pet getPet(long petId) throws IdNotFound, NotAcceptable {
- return store.getPet(petId);
-}
-
-@Override /* PetStore */
-@RestPost(
- path="/pet",
- summary="Add a new pet to the store",
- swagger=@OpSwagger(
- tags="pet"
- ),
- roleGuard="ROLE_ADMIN || (ROLE_USER && ROLE_WRITABLE)" // Restrict access
to this method.
-)
-public long createPet(CreatePet pet) throws IdConflict, NotAcceptable,
UnsupportedMediaType {
- return store.create(pet).getId();
-}
-
-...
-```
-
-After running the `main` method in the client code to populate the database,
the page renders as follows: `http://localhost:5000/petstore/pet`
-
-The OPTIONS menu items takes you to the auto-generated Swagger UI for the
application: `http://localhost:10000/petstore/pet?method=OPTIONS`
-
-Since we've defined tags on our annotations, the pet-related operations are
all grouped under the pet tag:
-
-Information for all HTTP parts is automatically generated:
-
-The schema models for POJO models is available in the Responses section of an
operation:
-
-Auto-generated examples are available for all supported languages:
-
-For example, application/json5:
-
-Examples can be derived in a number of ways.
-In our case, we've defined a static method on our Pet class annotated with
`@Example`:
-
-####
[Pet.java](https://github.com/apache/juneau-petstore/blob/master/juneau-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java)
-
-```java
-@Example
-public static Pet example() {
- return new Pet()
- .id(123)
- .species(Species.DOG)
- .name("Doggie")
- .tags("friendly","smart")
- .status(PetStatus.AVAILABLE);
-}
-```
-
-Similar functionality exists for request bodies as well:
-
-At the bottom of the page is a listing of the POJO models in the app:
\ No newline at end of file
diff --git a/pages/topics/19.01.JuneauExamplesCore.md
b/pages/topics/19.01.JuneauExamplesCore.md
index d3c1872c38..c6b4c6c4aa 100644
--- a/pages/topics/19.01.JuneauExamplesCore.md
+++ b/pages/topics/19.01.JuneauExamplesCore.md
@@ -140,8 +140,7 @@ The examples follow these common patterns:
The examples in this module serve as the foundation for more complex scenarios
found in:
<tree>
-<node-0><java-project><a
href="https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest"
target="_blank">juneau-examples-rest</a></java-project> - REST API examples
using these core concepts</node-0>
-<node-0><java-project><a href="https://github.com/apache/juneau-petstore"
target="_blank">juneau-petstore</a></java-project> - Complete application
demonstrating end-to-end usage</node-0>
+<node-0><java-project><a
href="https://github.com/apache/juneau/tree/master/juneau-petstore"
target="_blank">juneau-petstore</a></java-project> - Complete petstore showcase
application (Jetty/Microservice + Spring Boot deployments) demonstrating
end-to-end usage</node-0>
<node-0><java-project><a
href="https://github.com/apache/juneau/tree/master/juneau-microservice"
target="_blank">juneau-microservice</a></java-project> - Microservice examples
building on core serialization</node-0>
</tree>
@@ -150,7 +149,7 @@ The examples in this module serve as the foundation for
more complex scenarios f
<tree>
<node-0><java-doc><a href="/docs/topics/JuneauMarshallBasics"
target="_blank">Juneau Marshall Basics</a></java-doc> - Core marshalling
concepts</node-0>
<node-0><java-doc><a href="/docs/topics/JuneauEcosystemOverview"
target="_blank">Juneau Ecosystem Overview</a></java-doc> - Overall framework
architecture</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesRest"
target="_blank">juneau-examples-rest</a></java-doc> - REST-specific
examples</node-0>
+<node-0><java-doc><a href="/docs/topics/JuneauPetstoreOverview"
target="_blank">juneau-petstore</a></java-doc> - REST-specific examples via the
petstore showcase application</node-0>
</tree>
## Source Code
diff --git a/pages/topics/19.02.JuneauExamplesRest.md
b/pages/topics/19.02.JuneauExamplesRest.md
deleted file mode 100644
index 128a158623..0000000000
--- a/pages/topics/19.02.JuneauExamplesRest.md
+++ /dev/null
@@ -1,262 +0,0 @@
----
-title: "juneau-examples-rest"
-slug: JuneauExamplesRest
----
-
-# juneau-examples-rest
-
-The
[juneau-examples-rest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest)
module provides comprehensive examples demonstrating how to build REST APIs
using Apache Juneau's REST server capabilities.
-
-## Overview
-
-This module showcases practical examples of building REST services with
Juneau, including:
-
-- REST resource implementation
-- HTTP method handling
-- Request/response serialization
-- Error handling and validation
-- Integration with various data sources
-
-## Getting Started
-
-To use the examples in this module, add the following dependencies to your
project:
-
-```xml
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-rest-server</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-rest-client</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-```
-
-## Example Resources
-
-###
[HelloWorldResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/HelloWorldResource.java)
-A simple REST resource demonstrating basic HTTP method handling and response
serialization.
-
-**Features:**
-- GET method implementation
-- JSON response serialization
-- Simple POJO return types
-- Basic error handling
-
-###
[RequestEchoResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RequestEchoResource.java)
-Shows how to handle incoming requests and echo back request information.
-
-**Features:**
-- Request object inspection
-- Header and parameter access
-- Request body parsing
-- Response customization
-
-###
[PhotosResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/PhotosResource.java)
-Demonstrates file handling and binary data management in REST APIs.
-
-**Features:**
-- File upload handling
-- Binary data processing
-- Image metadata extraction
-- File serving capabilities
-
-### DTO Bean Examples
-
-####
[AtomFeedResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/dto/AtomFeedResource.java)
-Shows how to create and serve Atom feeds using Juneau's DTO bean capabilities.
-
-**Features:**
-- Atom feed generation
-- RSS/Atom standard compliance
-- Dynamic content updates
-- Feed metadata management
-
-####
[JsonSchemaResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/dto/JsonSchemaResource.java)
-Demonstrates JSON Schema generation for API documentation and validation.
-
-**Features:**
-- Automatic schema generation
-- API documentation
-- Request/response validation
-- Schema customization
-
-### Command Pattern Examples
-
-####
[EchoCommand.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/command/EchoCommand.java)
-Illustrates the command pattern implementation for REST operations.
-
-**Features:**
-- Command object design
-- Parameter validation
-- Result processing
-- Error handling
-
-## Advanced Features
-
-### AdminGuard
-Demonstrates security and access control in REST APIs.
-
-**Features:**
-- Authentication checking
-- Authorization validation
-- Security context handling
-- Access control patterns
-
-###
[UtilityBeansResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UtilityBeansResource.java)
-Shows how to create utility resources for common operations.
-
-**Features:**
-- Utility method exposure
-- Common operation patterns
-- Reusable functionality
-- Service composition
-
-###
[HtmlBeansResource.java](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/HtmlBeansResource.java)
-Demonstrates HTML generation and web interface creation.
-
-**Features:**
-- HTML response generation
-- Template-based rendering
-- Web interface creation
-- Form handling
-
-## Project Structure
-
-The examples are organized in a clear package structure:
-
-```
-org.apache.juneau.examples.rest/
-├── HelloWorldResource.java
-├── RequestEchoResource.java
-├── PhotosResource.java
-├── AdminGuard.java
-├── UtilityBeansResource.java
-├── HtmlBeansResource.java
-├── command/
-│ └── EchoCommand.java
-└── dto/
- ├── AtomFeedResource.java
- ├── JsonSchemaResource.java
- └── DtoExamples.java
-```
-
-## Configuration Examples
-
-### Basic REST Configuration
-```java
-@Rest(
- path="/api",
- serializers={JsonSerializer.class, XmlSerializer.class},
- parsers={JsonParser.class, XmlParser.class}
-)
-public class MyResource {
- // Resource implementation
-}
-```
-
-### Advanced Configuration
-```java
-@Rest(
- path="/api/v1",
- serializers={JsonSerializer.class, XmlSerializer.class,
HtmlSerializer.class},
- parsers={JsonParser.class, XmlParser.class, HtmlParser.class},
- config={
- @RestConfig(name="REST_allowMethodParam", value="true"),
- @RestConfig(name="REST_allowHeaderParam", value="true")
- }
-)
-public class AdvancedResource {
- // Advanced resource implementation
-}
-```
-
-## Testing the Examples
-
-### Running Individual Examples
-Each resource can be tested independently by deploying it to a servlet
container or using the embedded Jetty server.
-
-### Integration Testing
-The module includes integration tests that demonstrate:
-- End-to-end request/response cycles
-- Error scenario handling
-- Performance characteristics
-- Cross-browser compatibility
-
-## Best Practices Demonstrated
-
-### Resource Design
-- Single responsibility principle
-- Clear method naming
-- Consistent error handling
-- Proper HTTP status codes
-
-### Data Handling
-- Input validation
-- Output formatting
-- Error serialization
-- Content type negotiation
-
-### Security
-- Authentication patterns
-- Authorization checks
-- Input sanitization
-- Output filtering
-
-## Integration with Other Modules
-
-These REST examples integrate with:
-
-<tree>
-<node-0><java-project><a
href="https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-core"
target="_blank">juneau-examples-core</a></java-project> - Uses core
serialization examples</node-0>
-<node-0><java-project><a href="https://github.com/apache/juneau-petstore"
target="_blank">juneau-petstore</a></java-project> - Provides foundation for
complete application</node-0>
-<node-0><java-project><a
href="https://github.com/apache/juneau/tree/master/juneau-microservice"
target="_blank">juneau-microservice</a></java-project> - Demonstrates
microservice patterns</node-0>
-</tree>
-
-## Deployment Options
-
-### Servlet Container
-Deploy to any Servlet 3.1+ container:
-- Tomcat
-- Jetty
-- WildFly
-- WebLogic
-
-### Spring Boot Integration
-Use with Spring Boot for rapid development:
-```java
-@SpringBootApplication
-public class Application {
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-}
-```
-
-### Embedded Server
-Run as standalone application with embedded server.
-
-## Related Documentation
-
-<tree>
-<node-0><java-doc><a href="/docs/topics/JuneauRestServerBasics"
target="_blank">Juneau REST Server Basics</a></java-doc> - Core REST server
concepts</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauRestClientBasics"
target="_blank">Juneau REST Client Basics</a></java-doc> - REST client
usage</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesCore"
target="_blank">juneau-examples-core</a></java-doc> - Core serialization
examples</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauPetstoreBasics"
target="_blank">juneau-petstore</a></java-doc> - Complete application
example</node-0>
-</tree>
-
-## Source Code
-
-The complete source code for all REST examples is available in the
[juneau-examples-rest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest)
module of the Apache Juneau project.
-
-## Contributing
-
-To contribute new REST examples:
-
-1. Follow RESTful design principles
-2. Include comprehensive error handling
-3. Provide clear documentation
-4. Test with various HTTP clients
-5. Update this documentation when adding new examples
diff --git a/pages/topics/19.03.JuneauExamplesRestJetty.md
b/pages/topics/19.03.JuneauExamplesRestJetty.md
deleted file mode 100644
index c6af7c8a17..0000000000
--- a/pages/topics/19.03.JuneauExamplesRestJetty.md
+++ /dev/null
@@ -1,318 +0,0 @@
----
-title: "juneau-examples-rest-jetty"
-slug: JuneauExamplesRestJetty
----
-
-# juneau-examples-rest-jetty
-
-The
[juneau-examples-rest-jetty](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest-jetty)
module demonstrates how to deploy Juneau REST servers using embedded Jetty
server for standalone microservice applications.
-
-## Overview
-
-This example shows how to create a lightweight, self-contained REST
microservice using Apache Juneau's Jetty integration. It's perfect for
scenarios where you need a standalone application that can be easily deployed
and run without external dependencies.
-
-## Getting Started
-
-### Prerequisites
-- Java 17+
-- Maven 3.6+
-
-### Dependencies
-
-Add the following dependencies to your project:
-
-```xml
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-microservice-jetty</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-examples-rest</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-```
-
-## Example Implementation
-
-### Main Application Class
-
-The example demonstrates a simple REST microservice using the
[App](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java)
class:
-
-```java
-package org.apache.juneau.examples.rest.jetty;
-
-import org.apache.juneau.examples.rest.RootResources;
-import org.apache.juneau.microservice.jetty.*;
-
-public class App {
- public static void main(String[] args) throws Exception {
- JettyMicroservice
- .create()
- .args(args)
- .servlet(RootResources.class)
- .build()
- .start()
- .startConsole()
- .join();
- }
-}
-```
-
-### Key Features
-
-- **Embedded Jetty Server** - No external servlet container required
-- **Standalone Application** - Can be run as a simple JAR file
-- **Configuration Support** - Uses `examples.cfg` configuration file
-- **Console Interface** - Built-in management console
-- **Resource Integration** - Seamlessly integrates with juneau-examples-rest
resources
-
-## Configuration
-
-### Configuration File
-
-The application looks for an `examples.cfg` file in the home directory. This
file can contain various configuration options:
-
-```properties
-# Server configuration
-server.port=8080
-server.host=localhost
-
-# Logging configuration
-logging.level=INFO
-logging.file=microservice.log
-
-# REST configuration
-rest.path=/api
-rest.serializers=JsonSerializer,XmlSerializer
-rest.parsers=JsonParser,XmlParser
-```
-
-### Command Line Arguments
-
-The application accepts standard command line arguments:
-
-```bash
-java -jar juneau-examples-rest-jetty.jar --port=8080 --host=0.0.0.0
-```
-
-## Running the Example
-
-### Development Mode
-
-```bash
-# Clone the repository
-git clone https://github.com/apache/juneau.git
-cd juneau
-
-# Build the project
-mvn clean package
-
-# Run the Jetty example
-java -jar
juneau-examples/juneau-examples-rest-jetty/target/juneau-examples-rest-jetty-${version}.jar
-```
-
-### Production Deployment
-
-```bash
-# Run with custom configuration
-java -jar juneau-examples-rest-jetty.jar --config=/path/to/config.cfg
-
-# Run with specific port
-java -jar juneau-examples-rest-jetty.jar --port=9090
-
-# Run with console disabled
-java -jar juneau-examples-rest-jetty.jar --no-console
-```
-
-## Available Endpoints
-
-Once running, the application provides access to all the REST examples from
the
[juneau-examples-rest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest)
module:
-
-- **Root Resources** - `GET /api/`
-- **Hello World** - `GET /api/helloWorld`
-- **Request Echo** - `GET /api/requestEcho`
-- **Photos** - `GET /api/photos`
-- **DTO Bean Examples** - Various DTO bean demonstration endpoints
-
-## Architecture
-
-### JettyMicroservice Class
-
-The
[App](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java)
class provides:
-
-- **Embedded Jetty Server** - Lightweight HTTP server
-- **REST Servlet Integration** - Automatic servlet registration
-- **Configuration Management** - File and command-line configuration
-- **Console Interface** - Built-in management and monitoring
-- **Graceful Shutdown** - Proper resource cleanup
-
-### Resource Integration
-
-The example integrates with the
[juneau-examples-rest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest)
module, providing:
-
-- **Pre-built REST Resources** - Ready-to-use example endpoints
-- **DTO Bean Examples** - Various data transfer object bean demonstrations
-- **Command Patterns** - Example command implementations
-- **Utility Resources** - Common utility endpoints
-
-## Development Patterns
-
-### Custom Microservice
-
-You can extend the
[App](https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java)
class for custom behavior:
-
-```java
-public class CustomApp extends JettyMicroservice {
-
- @Override
- protected void configure() {
- // Custom configuration
- setPort(9090);
- setHost("0.0.0.0");
- addServlet(CustomResource.class);
- }
-
- public static void main(String[] args) throws Exception {
- new CustomApp().start().join();
- }
-}
-```
-
-### Multiple Servlets
-
-Register multiple REST servlets:
-
-```java
-JettyMicroservice
- .create()
- .servlet(RootResources.class, "/api/*")
- .servlet(AdminResources.class, "/admin/*")
- .servlet(PublicResources.class, "/public/*")
- .build()
- .start();
-```
-
-## Testing
-
-### Integration Tests
-
-The module includes integration tests in
[juneau-examples-rest-jetty-ftest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest-jetty-ftest):
-
-- **Root Content Tests** - Verify root endpoint responses
-- **Resource Tests** - Test individual REST resources
-- **End-to-End Tests** - Complete request/response cycle testing
-
-### Running Tests
-
-```bash
-# Run integration tests
-mvn test -pl juneau-examples/juneau-examples-rest-jetty-ftest
-
-# Run with specific test
-mvn test -pl juneau-examples/juneau-examples-rest-jetty-ftest
-Dtest=RootResourcesTest
-```
-
-## Deployment Options
-
-### JAR Deployment
-
-```bash
-# Create executable JAR
-mvn clean package
-
-# Run standalone
-java -jar target/juneau-examples-rest-jetty-${version}.jar
-```
-
-### Docker Deployment
-
-```dockerfile
-FROM openjdk:17-jre-slim
-COPY target/juneau-examples-rest-jetty.jar app.jar
-EXPOSE 8080
-ENTRYPOINT ["java", "-jar", "/app.jar"]
-```
-
-### System Service
-
-Create a systemd service file:
-
-```ini
-[Unit]
-Description=Juneau REST Jetty Example
-After=network.target
-
-[Service]
-Type=simple
-User=juneau
-ExecStart=/usr/bin/java -jar /opt/juneau/juneau-examples-rest-jetty.jar
-Restart=always
-
-[Install]
-WantedBy=multi-user.target
-```
-
-## Monitoring and Management
-
-### Built-in Console
-
-The application includes a management console accessible at `/console`:
-
-- **Server Status** - Current server state and metrics
-- **Configuration** - View and modify configuration
-- **Logs** - Real-time log viewing
-- **Health Checks** - Application health status
-
-### Health Endpoints
-
-Standard health check endpoints:
-
-- `GET /health` - Basic health status
-- `GET /health/detailed` - Detailed health information
-- `GET /metrics` - Application metrics
-
-## Best Practices
-
-### Configuration Management
-- Use environment-specific configuration files
-- Implement configuration validation
-- Support hot configuration reloading
-
-### Error Handling
-- Implement comprehensive error handling
-- Provide meaningful error messages
-- Log errors appropriately
-
-### Performance
-- Configure appropriate thread pools
-- Monitor memory usage
-- Implement request timeouts
-
-### Security
-- Implement authentication and authorization
-- Use HTTPS in production
-- Validate all inputs
-
-## Related Documentation
-
-<tree>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesRest"
target="_blank">juneau-examples-rest</a></java-doc> - REST API examples</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesRestSpringboot"
target="_blank">juneau-examples-rest-springboot</a></java-doc> - Spring Boot
examples</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauMicroserviceCore"
target="_blank">Juneau Microservice Core</a></java-doc> - Core microservice
components</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauRestServerBasics"
target="_blank">Juneau REST Server Basics</a></java-doc> - REST server
fundamentals</node-0>
-</tree>
-
-## Source Code
-
-The complete source code for the Jetty examples is available in the
[juneau-examples-rest-jetty](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest-jetty)
module of the Apache Juneau project.
-
-## Contributing
-
-To contribute improvements to the Jetty examples:
-
-1. Follow the established patterns in the existing code
-2. Include comprehensive tests
-3. Update documentation when adding new features
-4. Ensure backward compatibility
diff --git a/pages/topics/19.04.JuneauExamplesRestSpringboot.md
b/pages/topics/19.04.JuneauExamplesRestSpringboot.md
deleted file mode 100644
index 8e824ef7e5..0000000000
--- a/pages/topics/19.04.JuneauExamplesRestSpringboot.md
+++ /dev/null
@@ -1,473 +0,0 @@
----
-title: "juneau-examples-rest-springboot"
-slug: JuneauExamplesRestSpringboot
----
-
-# juneau-examples-rest-springboot
-
-The
[juneau-examples-rest-springboot](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest-springboot)
module demonstrates how to integrate Apache Juneau REST servers with Spring
Boot for enterprise-grade microservice applications.
-
-## Overview
-
-This example shows how to leverage Spring Boot's powerful features while using
Juneau's REST capabilities. It demonstrates Spring Boot integration patterns,
dependency injection, and enterprise deployment scenarios.
-
-## Getting Started
-
-### Prerequisites
-- Java 17+
-- Maven 3.6+
-- Spring Boot 2.0+ (tested with Spring Boot 2.7+)
-
-### Dependencies
-
-Add the following dependencies to your project:
-
-```xml
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-rest-server-springboot</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-<dependency>
- <groupId>org.apache.juneau</groupId>
- <artifactId>juneau-examples-rest</artifactId>
- <version>${juneau.version}</version>
-</dependency>
-<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- <version>${spring.boot.version}</version>
-</dependency>
-<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- <version>${spring.boot.version}</version>
-</dependency>
-```
-
-## Example Implementation
-
-### Main Application Class
-
-The example demonstrates Spring Boot integration with Juneau REST:
-
-```java
-package org.apache.juneau.examples.rest.springboot;
-
-import org.apache.juneau.rest.server.*;
-import org.apache.juneau.rest.server.springboot.*;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.builder.*;
-import org.springframework.boot.web.servlet.*;
-import org.springframework.context.annotation.*;
-import org.springframework.stereotype.Controller;
-
-@SpringBootApplication
-@Controller
-public class App {
-
- public static void main(String[] args) {
- try {
- new SpringApplicationBuilder(App.class).run(args);
- System.out.println("Initialized. App available on
http://localhost:5000");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Bean
- public RootResources getRootResources() {
- return new RootResources();
- }
-
- @Bean
- public HelloWorldResource getHelloWorldResource() {
- return new HelloWorldResource();
- }
-
- @Bean
- public HelloWorldMessageProvider getHelloWorldMessageProvider() {
- return new HelloWorldMessageProvider("Hello Spring injection user!");
- }
-
- @Bean
- public ServletRegistrationBean<jakarta.servlet.Servlet>
getRootServlet(RootResources rootResources) {
- return new ServletRegistrationBean<>(rootResources, "/*");
- }
-}
-```
-
-### Key Features
-
-- **Spring Boot Integration** - Full Spring Boot auto-configuration
-- **Dependency Injection** - Spring's IoC container integration
-- **Bean Management** - REST resources as Spring beans
-- **Actuator Support** - Built-in monitoring and management
-- **Configuration Properties** - Spring Boot configuration support
-
-## Spring Boot Integration Patterns
-
-### REST Resource as Spring Bean
-
-```java
-@Bean
-public HelloWorldResource getHelloWorldResource() {
- return new HelloWorldResource();
-}
-```
-
-### Dependency Injection in REST Resources
-
-```java
-@Rest(path="/hello")
-public class HelloWorldResource extends SpringRestServlet {
-
- @Autowired
- private HelloWorldMessageProvider messageProvider;
-
- @RestGet
- public String getMessage() {
- return messageProvider.getMessage();
- }
-}
-```
-
-### Servlet Registration
-
-```java
-@Bean
-public ServletRegistrationBean<jakarta.servlet.Servlet>
getRootServlet(RootResources rootResources) {
- return new ServletRegistrationBean<>(rootResources, "/*");
-}
-```
-
-## Configuration
-
-### Application Properties
-
-Configure the application using `application.properties`:
-
-```properties
-# Server configuration
-server.port=5000
-server.servlet.context-path=/
-
-# Spring Boot configuration
-spring.application.name=juneau-examples-rest-springboot
-spring.profiles.active=dev
-
-# Juneau REST configuration
-juneau.rest.path=/api
-juneau.rest.serializers=JsonSerializer,XmlSerializer
-juneau.rest.parsers=JsonParser,XmlParser
-
-# Logging configuration
-logging.level.org.apache.juneau=DEBUG
-logging.level.org.springframework=INFO
-```
-
-### YAML Configuration
-
-Alternative YAML configuration:
-
-```yaml
-server:
- port: 5000
- servlet:
- context-path: /
-
-spring:
- application:
- name: juneau-examples-rest-springboot
- profiles:
- active: dev
-
-juneau:
- rest:
- path: /api
- serializers:
- - JsonSerializer
- - XmlSerializer
- parsers:
- - JsonParser
- - XmlParser
-
-logging:
- level:
- org.apache.juneau: DEBUG
- org.springframework: INFO
-```
-
-## Running the Example
-
-### Development Mode
-
-```bash
-# Clone the repository
-git clone https://github.com/apache/juneau.git
-cd juneau
-
-# Build the project
-mvn clean package
-
-# Run the Spring Boot example
-mvn spring-boot:run -pl juneau-examples/juneau-examples-rest-springboot
-```
-
-### Production Deployment
-
-```bash
-# Run with specific profile
-java -jar juneau-examples-rest-springboot.jar --spring.profiles.active=prod
-
-# Run with custom configuration
-java -jar juneau-examples-rest-springboot.jar --server.port=8080
-
-# Run with external configuration
-java -jar juneau-examples-rest-springboot.jar
--spring.config.location=classpath:/application-prod.properties
-```
-
-## Available Endpoints
-
-The application provides all REST examples from the
[juneau-examples-rest](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest)
module:
-
-- **Root Resources** - `GET /api/`
-- **Hello World** - `GET /api/helloWorld`
-- **Request Echo** - `GET /api/requestEcho`
-- **Photos** - `GET /api/photos`
-- **DTO Bean Examples** - Various DTO bean demonstration endpoints
-
-### Spring Boot Actuator Endpoints
-
-Additional Spring Boot management endpoints:
-
-- **Health Check** - `GET /actuator/health`
-- **Application Info** - `GET /actuator/info`
-- **Metrics** - `GET /actuator/metrics`
-- **Environment** - `GET /actuator/env`
-
-## Advanced Features
-
-### Profile-Based Configuration
-
-```java
-@Configuration
-@Profile("dev")
-public class DevConfig {
-
- @Bean
- public HelloWorldMessageProvider devMessageProvider() {
- return new HelloWorldMessageProvider("Hello from DEV environment!");
- }
-}
-
-@Configuration
-@Profile("prod")
-public class ProdConfig {
-
- @Bean
- public HelloWorldMessageProvider prodMessageProvider() {
- return new HelloWorldMessageProvider("Hello from PROD environment!");
- }
-}
-```
-
-### Custom Configuration Properties
-
-```java
-@ConfigurationProperties(prefix = "juneau.rest")
-public class JuneauRestProperties {
-
- private String path = "/api";
- private List<String> serializers = Arrays.asList("JsonSerializer");
- private List<String> parsers = Arrays.asList("JsonParser");
-
- // Getters and setters
-}
-```
-
-### Conditional Bean Creation
-
-```java
-@Bean
-@ConditionalOnProperty(name = "juneau.rest.console.enabled", havingValue =
"true")
-public RestConsole getRestConsole() {
- return new RestConsole();
-}
-```
-
-## Testing
-
-### Unit Tests
-
-```java
-@SpringBootTest
-@AutoConfigureTestDatabase
-class HelloWorldResourceTest {
-
- @Autowired
- private HelloWorldResource helloWorldResource;
-
- @Test
- void testGetMessage() {
- String message = helloWorldResource.getMessage();
- assertThat(message).isNotNull();
- }
-}
-```
-
-### Integration Tests
-
-```java
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class RestIntegrationTest {
-
- @Autowired
- private TestRestTemplate restTemplate;
-
- @Test
- void testHelloWorldEndpoint() {
- ResponseEntity<String> response =
restTemplate.getForEntity("/api/helloWorld", String.class);
- assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
- }
-}
-```
-
-## Deployment Options
-
-### JAR Deployment
-
-```bash
-# Create executable JAR
-mvn clean package
-
-# Run standalone
-java -jar target/juneau-examples-rest-springboot-${version}.jar
-```
-
-### Docker Deployment
-
-```dockerfile
-FROM openjdk:17-jre-slim
-COPY target/juneau-examples-rest-springboot.jar app.jar
-EXPOSE 5000
-ENTRYPOINT ["java", "-jar", "/app.jar"]
-```
-
-### Kubernetes Deployment
-
-```yaml
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: juneau-springboot-example
-spec:
- replicas: 3
- selector:
- matchLabels:
- app: juneau-springboot-example
- template:
- metadata:
- labels:
- app: juneau-springboot-example
- spec:
- containers:
- - name: app
- image: juneau-springboot-example:latest
- ports:
- - containerPort: 5000
- env:
- - name: SPRING_PROFILES_ACTIVE
- value: "prod"
-```
-
-## Monitoring and Management
-
-### Spring Boot Actuator
-
-Enable comprehensive monitoring:
-
-```properties
-# Actuator configuration
-management.endpoints.web.exposure.include=health,info,metrics,env
-management.endpoint.health.show-details=always
-management.info.env.enabled=true
-```
-
-### Custom Health Indicators
-
-```java
-@Component
-public class JuneauHealthIndicator implements HealthIndicator {
-
- @Override
- public Health health() {
- // Custom health check logic
- return Health.up()
- .withDetail("juneau", "Available")
- .build();
- }
-}
-```
-
-### Metrics Integration
-
-```java
-@Component
-public class JuneauMetrics {
-
- private final MeterRegistry meterRegistry;
-
- public JuneauMetrics(MeterRegistry meterRegistry) {
- this.meterRegistry = meterRegistry;
- }
-
- public void recordRequest(String endpoint) {
- meterRegistry.counter("juneau.requests", "endpoint",
endpoint).increment();
- }
-}
-```
-
-## Best Practices
-
-### Configuration Management
-- Use Spring profiles for environment-specific configuration
-- Implement configuration validation
-- Use `@ConfigurationProperties` for type-safe configuration
-
-### Dependency Injection
-- Prefer constructor injection over field injection
-- Use `@Qualifier` for multiple bean implementations
-- Implement proper bean lifecycle management
-
-### Error Handling
-- Use Spring's `@ControllerAdvice` for global error handling
-- Implement custom exception handlers
-- Provide meaningful error responses
-
-### Security
-- Integrate with Spring Security
-- Use HTTPS in production
-- Implement proper authentication and authorization
-
-## Related Documentation
-
-<tree>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesRest"
target="_blank">juneau-examples-rest</a></java-doc> - REST API examples</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauExamplesRestJetty"
target="_blank">juneau-examples-rest-jetty</a></java-doc> - Jetty
examples</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauRestServerSpringbootBasics"
target="_blank">Juneau REST Server Spring Boot</a></java-doc> - Spring Boot
integration</node-0>
-<node-0><java-doc><a href="/docs/topics/JuneauRestServerBasics"
target="_blank">Juneau REST Server Basics</a></java-doc> - REST server
fundamentals</node-0>
-</tree>
-
-## Source Code
-
-The complete source code for the Spring Boot examples is available in the
[juneau-examples-rest-springboot](https://github.com/apache/juneau/tree/master/juneau-examples/juneau-examples-rest-springboot)
module of the Apache Juneau project.
-
-## Contributing
-
-To contribute improvements to the Spring Boot examples:
-
-1. Follow Spring Boot best practices
-2. Include comprehensive tests
-3. Update documentation when adding new features
-4. Ensure compatibility with supported Spring Boot versions
diff --git a/pages/topics/JuneauPetstoreOverview.md
b/pages/topics/JuneauPetstoreOverview.md
new file mode 100644
index 0000000000..37d51f03da
--- /dev/null
+++ b/pages/topics/JuneauPetstoreOverview.md
@@ -0,0 +1,98 @@
+---
+title: "juneau-petstore Overview"
+slug: JuneauPetstoreOverview
+---
+
+The **juneau-petstore** family is the canonical Apache Juneau showcase
application. It packages a small, complete sample petstore (pets, orders,
users) and deploys it under two runtimes — Jetty/`Microservice` and Spring Boot
— using the *exact same* REST surface, demonstrating that a Juneau service is
just a `Servlet` and travels unchanged across deployment containers.
+
+> **In-tree, no external repo.** The petstore lives directly in the Juneau
reactor under `juneau-petstore/`. The earlier external `apache/juneau-petstore`
repository has been retired in favor of these modules.
+
+## Module layout
+
+```
+juneau-petstore/ (top-level aggregator, packaging=pom)
+├── juneau-petstore-core/ Shared, deployment-agnostic surface
+├── juneau-petstore-jetty/ Jetty/Microservice deployment
+└── juneau-petstore-springboot/ Spring Boot deployment
+```
+
+Each module ships as a plain `jar` (no OSGi-bundle wrapping for the sample).
The library Juneau modules they depend on are still OSGi bundles, so OSGi
consumers lose nothing.
+
+## What it demonstrates
+
+The **core-hosted surface** is identical across both deployments by
construction (it's shared code, not parallel copies):
+
+| Feature | Resource | Notes |
+|---|---|---|
+| Petstore CRUD | `PetStoreResource` (`/petstore/*`) |
`GET`/`POST`/`PUT`/`DELETE` over `/pets`, `/orders`, `/users`. Backed by an
in-memory `PetStore` service seeded from classpath JSON. |
+| Mustache view | `PetMustacheViewResource`
(`/pet-views/mustache/pets/{id}/view`) | Typed-`View` return path through
`juneau-rest-server-view-mustache`. |
+| FreeMarker view | `PetFreemarkerViewResource`
(`/pet-views/freemarker/pets/{id}/view`) | Typed-`View` return path through
`juneau-rest-server-view-freemarker`. |
+| No-build React SPA | `PetstoreUiResource`
(`/petstore-ui/static/petstore-ui.html`) | Headless-JSON + decoupled-SPA
pattern; loads React + Babel and uses `fetch()` against `/petstore/pets`. |
+| Bearer-token gate | `PetSecureResource` (`/petstore-secure/*`) | Fail-closed
`BearerTokenGuard` with a stub `TokenValidator`. Demonstrates the `@Auth
Principal` injection pattern. |
+
+The **deployment-specific surface** is intentionally non-parity and documented
as such:
+
+| Surface | Jetty deployment | Spring Boot deployment |
+|---|---|---|
+| Microservice admin | `ConfigResource`, `LogsResource`, `ShutdownResource` |
(omitted — Spring Boot has its own actuator) |
+| Spring `@Autowired` injection demo | (n/a — no Spring container) |
`HelloResource` + `HelloMessageProvider` (`/hello/*`) |
+
+## Running the petstore
+
+### Jetty / Microservice
+
+```sh
+python3 scripts/start-petstore-jetty.py
+```
+
+Default URL: `http://localhost:10000`. The interactive microservice console
accepts `exit`, `restart`, `help`, and `config` commands.
+
+### Spring Boot
+
+```sh
+python3 scripts/start-petstore-springboot.py
+```
+
+Default URL: `http://localhost:5000`.
+
+Both scripts use Maven to compile the relevant module if needed, then launch
the `App.main` of the chosen deployment.
+
+## Trying it out
+
+After starting either deployment, hit a few of the following URLs (replace the
port to match your deployment):
+
+- `GET http://localhost:10000/petstore/pets` — JSON list of seeded pets.
+- `GET http://localhost:10000/petstore/pets/1` — single pet (`Mr. Frisky`, the
seeded cat).
+- `GET http://localhost:10000/pet-views/mustache/pets/1/view` —
Mustache-rendered pet detail page.
+- `GET http://localhost:10000/pet-views/freemarker/pets/1/view` —
FreeMarker-rendered pet detail page.
+- `GET http://localhost:10000/petstore-ui/static/petstore-ui.html` — React SPA.
+- `GET http://localhost:10000/petstore-secure/pets` — `401 Unauthorized` (no
bearer).
+- `GET http://localhost:10000/petstore-secure/pets` with `Authorization:
Bearer petstore-user` — `200 OK` with pet list.
+- `GET http://localhost:10000/petstore-secure/whoami` with `Authorization:
Bearer petstore-admin` — returns the principal name.
+
+The Jetty deployment additionally exposes `/config`, `/logs`, `/shutdown`. The
Spring Boot deployment additionally exposes `/hello` (Spring-injected message).
+
+## How the REST surface stays runtime-agnostic
+
+The core's `PetStoreResource` extends `BasicRestServlet` (servlet API only —
nothing Spring or Microservice-specific). It is mounted differently by each
deployment's router:
+
+- **Jetty**: `RootResources extends BasicRestServletGroup` with
`@Rest(children=PetStoreResource.class)`. The `Microservice`'s
`JettyServerComponent` auto-mounts `@Bean Servlet`s.
+- **Spring Boot**: `RootResources extends BasicSpringRestServletGroup` (so
child resources resolve as Spring beans) with the same `@Rest(children=...)`.
Mounted via `ServletRegistrationBean` at `/*`.
+
+Switching runtimes is a matter of swapping the router base class and the
bootstrap; the resources themselves don't change.
+
+## Where to look in the source
+
+Start with these class-level Javadocs:
+
+- `org.apache.juneau.petstore.rest.PetStoreResource` — the CRUD demo.
+- `org.apache.juneau.petstore.service.PetStore` — the in-memory store.
+- `org.apache.juneau.petstore.rest.PetMustacheViewResource` /
`PetFreemarkerViewResource` — view-engine integration.
+- `org.apache.juneau.petstore.rest.PetstoreUiResource` — static-file mixin
demo.
+- `org.apache.juneau.petstore.rest.PetSecureResource` — bearer-token guard
demo.
+- `org.apache.juneau.petstore.jetty.App` /
`org.apache.juneau.petstore.jetty.RootResources` — Jetty deployment.
+- `org.apache.juneau.petstore.springboot.App` /
`org.apache.juneau.petstore.springboot.RootResources` — Spring Boot deployment.
+
+## History
+
+This page replaces the earlier `18.01–18.05.JuneauPetstore*` topic pages,
which described the now-retired external `apache/juneau-petstore` repository.
The legacy `juneau-examples-rest{,-jetty,-springboot}` family of modules has
likewise been retired; the in-tree `juneau-petstore-{core,jetty,springboot}` is
the canonical replacement.
diff --git a/sidebars.ts b/sidebars.ts
index 6c4b8816e0..57af482d42 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -2020,28 +2020,8 @@ const sidebars: SidebarsConfig = {
items: [
{
type: 'doc',
- id:
'topics/18.01.JuneauPetstoreBasics',
- label: '18.1.
juneau-petstore Basics',
- },
- {
- type: 'doc',
- id:
'topics/18.02.JuneauPetstoreRunning',
- label: '18.2. Running
the App',
- },
- {
- type: 'doc',
- id:
'topics/18.03.JuneauPetstoreApi',
- label: '18.3.
juneau-petstore-api',
- },
- {
- type: 'doc',
- id:
'topics/18.04.JuneauPetstoreClient',
- label: '18.4.
juneau-petstore-client',
- },
- {
- type: 'doc',
- id:
'topics/18.05.JuneauPetstoreServer',
- label: '18.5.
juneau-petstore-server',
+ id:
'topics/JuneauPetstoreOverview',
+ label: '18.1.
juneau-petstore Overview',
},
],
},
@@ -2055,21 +2035,6 @@ const sidebars: SidebarsConfig = {
id:
'topics/19.01.JuneauExamplesCore',
label: '19.1.
juneau-examples-core',
},
- {
- type: 'doc',
- id:
'topics/19.02.JuneauExamplesRest',
- label: '19.2.
juneau-examples-rest',
- },
- {
- type: 'doc',
- id:
'topics/19.03.JuneauExamplesRestJetty',
- label: '19.3.
juneau-examples-rest-jetty',
- },
- {
- type: 'doc',
- id:
'topics/19.04.JuneauExamplesRestSpringboot',
- label: '19.4.
juneau-examples-rest-springboot',
- },
],
},
{
@@ -2297,13 +2262,13 @@ const sidebars: SidebarsConfig = {
},
{
type:
'doc',
- id:
'developer-info/04.02.12.ScriptStartExamplesRestJetty',
- label:
'4.2.12. start-examples-rest-jetty.py',
+ id:
'developer-info/04.02.12.ScriptStartPetstoreJetty',
+ label:
'4.2.12. start-petstore-jetty.py',
},
{
type:
'doc',
- id:
'developer-info/04.02.13.ScriptStartExamplesRestSpringboot',
- label:
'4.2.13. start-examples-rest-springboot.py',
+ id:
'developer-info/04.02.13.ScriptStartPetstoreSpringboot',
+ label:
'4.2.13. start-petstore-springboot.py',
},
],
},
diff --git a/src/pages/downloads.md b/src/pages/downloads.md
index 5f7be6e2d7..1f89da3a05 100644
--- a/src/pages/downloads.md
+++ b/src/pages/downloads.md
@@ -52,8 +52,7 @@
- **`/projects`** - Eclipse Projects
- `my-springboot-microservice.zip` - Microservice starter project using
Spring Boot
- `juneau-examples-core.zip` - Core libraries examples
- - `juneau-examples-rest-jetty.zip` - REST libraries examples using Jetty
- - `juneau-examples-rest-springboot.zip` - REST libraries examples using
Spring Boot
+ - `juneau-petstore-jetty.zip` - Canonical petstore showcase application
starter (Jetty/Microservice deployment)
### Maven