blob: 87e2ab5aae186bde511d9502bfcf429932057ae3 [file]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SimpleApp :: causeway</title>
<link rel="canonical" href="https://causeway.apache.org/docs/latest/starters/simpleapp.html">
<meta name="generator" content="Antora 3.1.14">
<link rel="stylesheet" href="../../../_/css/site.css">
<link rel="stylesheet" href="../../../_/css/site-custom.css">
<link rel="home" href="https://causeway.apache.org" title="causeway">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://causeway.apache.org">
<span class="icon">
<img src="../../../_/img/causeway-logo-no-words-65x48.png"></img>
</span>
<span class="navbar-title">causeway</span>
</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<a class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Quick Start</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Starter Apps</span>
<a class="navbar-item" href="../../../docs/latest/starters/helloworld.html">Hello World</a>
<a class="navbar-item" href="../../../docs/latest/starters/simpleapp.html">Simple App</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Learning &amp; Tutorials</span>
<a class="navbar-item" href="../../../docs/latest/reference/about.html">Reference App</a>
<a class="navbar-item" href="https://danhaywood.gitlab.io/isis-petclinic-tutorial-docs/petclinic/1.16.2/intro.html">Petclinic</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Resources</span>
<a class="navbar-item" href="../../../docs/latest/resources/cheatsheet.html">Cheatsheet</a>
<a class="navbar-item" href="../../../docs/latest/resources/icons.html">Icons</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Guides</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Core</span>
<a class="navbar-item" href="../../../userguide/latest/about.html">User Guide</a>
<a class="navbar-item" href="../../../refguide/latest/about.html">Reference Guide</a>
<a class="navbar-item" href="../../../testing/latest/about.html">Testing Guide</a>
<a class="navbar-item" href="../../../security/latest/about.html">Security Guide</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">For use in apps</span>
<a class="navbar-item" href="../../../valuetypes/latest/about.html">Value Types</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Development</span>
<a class="navbar-item" href="../../../setupguide/latest/about.html">Setup Guide</a>
<a class="navbar-item" href="../../../conguide/latest/about.html">Contributors' Guide</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Components</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Security</span>
<a class="navbar-item" href="../../../security/latest/bypass/about.html">Bypass</a>
<a class="navbar-item" href="../../../security/latest/simple/about.html">Simple</a>
<a class="navbar-item" href="../../../security/latest/spring/about.html">Spring</a>
<a class="navbar-item" href="../../../security/latest/keycloak/about.html">Keycloak</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Viewers</span>
<a class="navbar-item" href="../../../vw/latest/about.html">Web UI (Wicket)</a>
<a class="navbar-item" href="../../../gqlv/latest/about.html">GraphQL API</a>
<a class="navbar-item" href="../../../vro/latest/about.html">REST API (Restful Objects)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Persistence</span>
<a class="navbar-item" href="../../../pjpa/latest/about.html">JPA (EclipseLink)</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Extensions</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Core</span>
<a class="navbar-item" href="../../../userguide/latest/commandlog/about.html">Command Log</a>
<a class="navbar-item" href="../../../userguide/latest/docgen/about.html">Doc Gen</a>
<a class="navbar-item" href="../../../userguide/latest/executionlog/about.html">Execution Log</a>
<a class="navbar-item" href="../../../userguide/latest/executionoutbox/about.html">Execution Outbox</a>
<a class="navbar-item" href="../../../userguide/latest/executionrepublisher/about.html">Execution Republisher</a>
<a class="navbar-item" href="../../../userguide/latest/excel/about.html">Excel</a>
<a class="navbar-item" href="../../../userguide/latest/flyway/about.html">Flyway</a>
<a class="navbar-item" href="../../../userguide/latest/layoutloaders/about.html">Layout Loaders</a>
<a class="navbar-item" href="../../../userguide/latest/titlecache/about.html">Title Cache</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Security</span>
<a class="navbar-item" href="../../../security/latest/secman/about.html">Secman</a>
<a class="navbar-item" href="../../../security/latest/audittrail/about.html">Audit Trail</a>
<a class="navbar-item" href="../../../security/latest/spring-oauth2/about.html">Spring OAuth2 Integration</a>
<a class="navbar-item" href="../../../security/latest/sessionlog/about.html">Session Log</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Web UI (Wicket)</span>
<a class="navbar-item" href="../../../vw/latest/fullcalendar/about.html">Full Calendar</a>
<a class="navbar-item" href="../../../vw/latest/pdfjs/about.html">pdf.js</a>
<a class="navbar-item" href="../../../vw/latest/sse/about.html">Server Side Events</a>
<a class="navbar-item" href="../../../vw/latest/tabular/about.html">Tabular Download</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">REST API (Restful Objects)</span>
<a class="navbar-item" href="../../../vro/latest/cors/about.html">CORS</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Persistence</span>
<a class="navbar-item" href="../../../querydsl/latest/about.html">QueryDSL</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Support</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Contact</span>
<a class="navbar-item" href="../../../docs/latest/support/slack-channel.html">Slack</a>
<a class="navbar-item" href="../../../docs/latest/support/mailing-list.html">Mailing Lists</a>
<a class="navbar-item" href="https://issues.apache.org/jira/browse/CAUSEWAY">JIRA</a>
<a class="navbar-item" href="https://stackoverflow.com/questions/tagged/causeway">Stack Overflow</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Releases</span>
<a class="navbar-item" href="../../../docs/latest/downloads/how-to.html">Downloads</a>
<a class="navbar-item" href="../../../relnotes/latest/about.html">Release Notes</a>
<hr class="navbar-divider"/>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Framework</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Process</span>
<a class="navbar-item" href="../../../comguide/latest/about.html">Committers' Guide</a>
<a class="navbar-item" href="../../../tooling/latest/about.html">Tooling</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Automated Analysis</span>
<a class="navbar-item" href="https://sonarcloud.io/dashboard?id=apache_causeway">SonarCloud.io</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Interim Builds</span>
<a class="navbar-item" href="../../../comguide/latest/nightly-builds.html">Nightly builds</a>
<a class="navbar-item" href="../../../comguide/latest/weekly-builds.html">Weekly builds</a>
<a class="navbar-item" href="https://apache-causeway-committers.github.io/causeway-nightly">Website Preview (not ASF hosted)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Development</span>
<a class="navbar-item" href="../../../core/latest/about.html">Internal Design Docs</a>
<a class="navbar-item" href="../../../regressiontests/latest/about.html">Regression Tests</a>
<a class="navbar-item" href="../../../incubator/latest/about.html">Incubator</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Thanks</span>
<a class="navbar-item" href="../../../more-thanks/latest/more-thanks.html">Acknowledgements</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">ASF</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="http://www.apache.org/">Apache Homepage</a>
<a class="navbar-item" href="https://www.apache.org/events/current-event">Events</a>
<a class="navbar-item" href="https://www.apache.org/licenses/">License</a>
<a class="navbar-item" href="https://www.apache.org/security/">Security</a>
<a class="navbar-item" href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy</a>
<a class="navbar-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
<a class="navbar-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a>
<hr class="navbar-divider"/>
<a class="navbar-item" href="https://whimsy.apache.org/board/minutes/Causeway.html">PMC board minutes</a>
</div>
</div>
<a class="navbar-item" href="../../../docs/latest/about.html">
<span class="icon">
<img src="../../../_/img/home.png"></img>
</span>
</a>
</div>
</div>
</nav>
</header>
<div class="body ">
<div class="nav-container" data-component="docs" data-version="3.3.0">
<aside class="nav">
<div class="panels">
<div class="nav-panel-search hide-for-print">
<input id="algolia-search-input" placeholder="Search"></span>
</div>
<div class="nav-panel-pagination">
<a class="page-previous disabled" rel="prev" href="" title=""><span></span></a>
<a class="page-next disabled" rel="next"
href="" title=""><span></span></a>
<!--
page.parent doesn't seem to be set...
<a class="page-parent disabled" rel="prev" href="" title=""><span></span></a>
-->
</div>
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="../about.html"> </a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">What is Apache Causeway?</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../what-is-apache-causeway/causeway-in-pictures.html">Apache Causeway in pictures</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../what-is-apache-causeway/common-use-cases.html">Common Use Cases</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Quick Start</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/starters/helloworld.html">HelloWorld</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/starters/simpleapp.html">SimpleApp</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/parent-pom/about.html">Parent POM</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/mavendeps/about.html">Webapp Aggregator POM</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Learning &amp; Tutorials</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/referenceapp/about.html">Reference App</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../../tutorials/latest/petclinic/about.html">Petclinic</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Resources</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/resources/cheatsheet.html">Cheat Sheet</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../latest/resources/icons.html">Icons</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Guides</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Core</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/about.html">User Guide</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../refguide/latest/about.html">Reference Guide</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../testing/latest/about.html">Testing Guide</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/about.html">Security Guide</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">for use in apps</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../valuetypes/latest/about.html">Value Types</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Development</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../setupguide/latest/about.html">Setup Guide</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../conguide/latest/about.html">Contributors' Guide</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Components</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Security</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/bypass/about.html">Bypass</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/simple/about.html">Simple</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/spring/about.html">Spring</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/keycloak/about.html">Keycloak</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Viewers</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vw/latest/about.html">Web UI (Wicket)</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../gqlv/latest/about.html">GraphQL API</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vro/latest/about.html">REST API (Restful Objects)</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Persistence</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../pjpa/latest/about.html">JPA (EclipseLink)</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../querydsl/latest/about.html">QueryDSL</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Extensions</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Core</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/commandlog/about.html">Command Log</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/docgen/about.html">DocGen</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/executionlog/about.html">Execution Log</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/executionoutbox/about.html">Execution Outbox</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/executionrepublisher/about.html">Execution Republisher</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/excel/about.html">Excel</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/flyway/about.html">Flyway</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/layoutloaders/about.html">Layout Loaders</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../userguide/latest/titlecache/about.html">Title Cache</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Security</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/secman/about.html">SecMan</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/audittrail/about.html">Audit Trail</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/spring-oauth2/about.html">Spring OAuth2</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../security/latest/sessionlog/about.html">Session Log</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Persistence</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../querydsl/latest/about.html">QueryDSL</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text"><em>Web UI (Wicket viewer)</em></span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vw/latest/fullcalendar/about.html">Full Calendar</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vw/latest/pdfjs/about.html">PDF.js</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vw/latest/sse/about.html">Server Side Events</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vw/latest/tabular/about.html">Tabular Download</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text"><em>REST API (Restful Objects)</em></span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../vro/latest/cors/about.html">CORS</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Support</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Contact</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../latest/support/slack-channel.html">Slack</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../latest/support/mailing-list.html">Mailing Lists</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://issues.apache.org/jira/secure/RapidBoard.jspa?rapidView=87">ASF JIRA</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="http://stackoverflow.com/questions/tagged/causeway">Stack Overflow</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Releases</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../latest/downloads/how-to.html">Downloads</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../relnotes/latest/about.html">Release Notes</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Framework</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Process</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../comguide/latest/about.html">Committers' Guide</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Automated Analysis</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://sonarcloud.io/dashboard?id=apache_causeway">SonarCloud.io</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Interim Builds</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../comguide/latest/nightly-builds.html">Nightly Builds</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../comguide/latest/weekly-builds.html">Weekly Builds</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://apache-causeway-committers.github.io/causeway-nightly">Website Preview</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Development</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../core/latest/about.html">Internal Design Docs</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../regressiontests/latest/about.html">Regression Tests</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../../incubator/latest/about.html">Incubator</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Thanks</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../more-thanks/more-thanks.html">Acknowledgements</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Further Resources</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Reading</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../going-deeper/articles-and-presentations.html">Articles &amp; Presentations</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../going-deeper/books.html">Books</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Academia</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="_attachments/Pawson-Naked-Objects-thesis.pdf">Naked Objects</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://esc.fnwi.uva.nl/thesis/centraal/files/f270412620.pdf">CLCauseway: An interface for Visually Impaired Users</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://esc.fnwi.uva.nl/thesis/centraal/files/f1051832702.pdf">Using blockchain to validate audit trail data in private business applications</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title"> </span>
<span class="version">3.3.0</span>
</div>
<ul class="components">
<li class="component is-current">
<span class="title"> </span>
<ul class="versions">
<li class="version">
<a href="../../latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../3.4.0/about.html">3.4.0</a>
</li>
<li class="version is-current">
<a href="../about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Committers' Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../comguide/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../comguide/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../comguide/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../comguide/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../comguide/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../comguide/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../comguide/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../comguide/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../comguide/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Contributors' Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../conguide/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../conguide/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../conguide/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../conguide/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../conguide/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../conguide/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../conguide/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../conguide/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../conguide/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Design Docs</span>
<ul class="versions">
<li class="version">
<a href="../../../core/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../core/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../core/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../core/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../core/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../core/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../core/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../core/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../core/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Extensions</span>
<ul class="versions">
<li class="version">
<a href="../../../extensions/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../extensions/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../extensions/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../extensions/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../extensions/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../extensions/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../extensions/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../extensions/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../extensions/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">GraphQL Viewer</span>
<ul class="versions">
<li class="version">
<a href="../../../gqlv/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../gqlv/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../gqlv/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../gqlv/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../gqlv/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../gqlv/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../gqlv/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../gqlv/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../gqlv/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Incubator Catalog</span>
<ul class="versions">
<li class="version">
<a href="../../../incubator/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../incubator/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../incubator/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../incubator/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../incubator/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../incubator/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../incubator/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../incubator/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../incubator/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">JDO/DataNucleus</span>
<ul class="versions">
<li class="version">
<a href="../../../pjdo/latest/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../pjdo/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../pjdo/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../pjdo/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../pjdo/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../pjdo/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../pjdo/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">JPA</span>
<ul class="versions">
<li class="version">
<a href="../../../pjpa/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../pjpa/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../pjpa/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../pjpa/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../pjpa/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../pjpa/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../pjpa/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../pjpa/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../pjpa/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">QueryDSL</span>
<ul class="versions">
<li class="version">
<a href="../../../querydsl/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../querydsl/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../querydsl/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../querydsl/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../querydsl/3.2.0/about.html">3.2.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Reference Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../refguide/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../refguide/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../refguide/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../refguide/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../refguide/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../refguide/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../refguide/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../refguide/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../refguide/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">regressiontests</span>
<ul class="versions">
<li class="version">
<a href="../../../regressiontests/latest/index.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.5.0/index.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.4.0/index.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.3.0/index.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.2.0/index.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.1.0/index.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/3.0.0/index.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/2.1.0/index.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../regressiontests/2.0.0/index.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Release Notes</span>
<ul class="versions">
<li class="version">
<a href="../../../relnotes/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../relnotes/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../relnotes/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../relnotes/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../relnotes/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../relnotes/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../relnotes/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../relnotes/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../relnotes/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">REST API (Restful Objects Viewer)</span>
<ul class="versions">
<li class="version">
<a href="../../../vro/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../vro/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../vro/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../vro/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../vro/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../vro/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../vro/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../vro/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../vro/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Security Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../security/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../security/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../security/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../security/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../security/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../security/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../security/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../security/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../security/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Setup Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../setupguide/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../setupguide/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../setupguide/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../setupguide/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../setupguide/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../setupguide/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../setupguide/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../setupguide/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../setupguide/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Testing Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../testing/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../testing/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../testing/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../testing/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../testing/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../testing/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../testing/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../testing/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../testing/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Tutorials</span>
<ul class="versions">
<li class="version">
<a href="../../../tutorials/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../tutorials/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../tutorials/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../tutorials/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../tutorials/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../tutorials/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../tutorials/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../tutorials/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../tutorials/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">User Guide</span>
<ul class="versions">
<li class="version">
<a href="../../../userguide/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../userguide/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../userguide/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../userguide/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../userguide/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../userguide/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../userguide/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../userguide/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../userguide/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Value Types Catalog</span>
<ul class="versions">
<li class="version">
<a href="../../../valuetypes/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../valuetypes/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Web UI (Wicket Viewer)</span>
<ul class="versions">
<li class="version">
<a href="../../../vw/latest/about.html">4.0.0-M1</a>
</li>
<li class="version">
<a href="../../../vw/3.5.0/about.html">3.5.0</a>
</li>
<li class="version">
<a href="../../../vw/3.4.0/about.html">3.4.0</a>
</li>
<li class="version">
<a href="../../../vw/3.3.0/about.html">3.3.0</a>
</li>
<li class="version">
<a href="../../../vw/3.2.0/about.html">3.2.0</a>
</li>
<li class="version">
<a href="../../../vw/3.1.0/about.html">3.1.0</a>
</li>
<li class="version">
<a href="../../../vw/3.0.0/about.html">3.0.0</a>
</li>
<li class="version">
<a href="../../../vw/2.1.0/about.html">2.1.0</a>
</li>
<li class="version">
<a href="../../../vw/2.0.0/about.html">2.0.0</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main role="main">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../latest/about.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../about.html"> </a></li>
<li><a href="simpleapp.html">SimpleApp</a></li>
</ul>
</nav>
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">3.3.0</button>
<div class="version-menu">
<a class="version" href="../../latest/starters/simpleapp.html">4.0.0-M1</a>
<a class="version" href="../../3.5.0/starters/simpleapp.html">3.5.0</a>
<a class="version" href="../../3.4.0/starters/simpleapp.html">3.4.0</a>
<a class="version is-current" href="simpleapp.html">3.3.0</a>
<a class="version" href="../../3.2.0/starters/simpleapp.html">3.2.0</a>
<a class="version" href="../../3.1.0/starters/simpleapp.html">3.1.0</a>
<a class="version" href="../../3.0.0/starters/simpleapp.html">3.0.0</a>
<a class="version" href="../../2.1.0/starters/simpleapp.html">2.1.0</a>
<a class="version" href="../../2.0.0/starters/simpleapp.html">2.0.0</a>
</div>
</div>
<div class="edit-this-page"><a href="https://github.com/apache/causeway/edit/3.3.0/starters/adoc/modules/starters/pages/simpleapp.adoc">Edit</a></div>
</div>
<article class="doc">
<a name="section-top"></a>
<h1 class="page">SimpleApp</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>The quickest way to get started building an application "for real" is to use the <code>simpleapp</code> starter app.</p>
</div>
<div class="paragraph">
<p>There are two variations of the application (and so two branches in the git repo).
One variation uses JPA as the ORM, the other uses JDO, so you can focus on whichever ORM you prefer.</p>
</div>
<div class="paragraph">
<p>The application is also built nightly as a docker image, so you can quickly try it out:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">docker run -d -p 8080:8080 apache/causeway-app-simpleapp:v3-jpa-SNAPSHOT</code></pre>
</div>
</div>
<div class="paragraph">
<p>Replace "v3-jpa" with "v3-jdo" if using the JDO ORM.</p>
</div>
<div class="paragraph">
<p>As with the <a href="../../latest/starters/helloworld.html" class="xref page">HelloWorld</a> starter app, the instructions <a href="#downloading-running">below</a> will download a minimal Apache Causeway app consisting of a single entity (<code>SimpleObject</code>) with supporting domain services.</p>
</div>
<div class="paragraph">
<p>However, unlike HelloWorld, this app also provides more structure to assist you as your application grows, with business logic placed in a separate Maven module (<code>simpleapp-&#8230;&#8203;-module-simple</code>) to the module that bootstraps the webapp (<code>simpleapp-&#8230;&#8203;-webapp</code>).
Replace "&#8230;&#8203;" with either "jpa" or "jdo", as appropriate.</p>
</div>
<div class="paragraph">
<p>The idea is that as your application grows in scope that you put each new area of functionality in its own module (copy-n-paste the <code>simpleapp-&#8230;&#8203;-module-simple</code> module).
These modules can depend on each other, but Maven will to ensure that dependencies between these areas of functionality are unidirectional.
In this way your application will be a "modular monolith"; said another way it will prevent your application from degenerating into a <a href="https://en.wikipedia.org/wiki/Big_ball_of_mud">big ball of mud</a>.
See also the discussion <a href="#structure-of-the-app">below</a>.</p>
</div>
<div class="paragraph">
<p>The application also includes examples of unit tests and integration tests.
You&#8217;ll find these in their own Maven modules (<code>simpleapp-&#8230;&#8203;-module-simple-tests</code> and <code>simpleapp-&#8230;&#8203;-webapp-tests</code>).
Normally we recommend that tests should be in the same Maven module as the code that they exercise.
The simpleapp doesn&#8217;t do it this way just to give you the option to exclude them while initially prototyping/exploring a domain.
You can use them as a reference once your ideas have solidifid and you need to start writing proper "production" code.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Apache Causeway is a Java based framework, so in terms of prerequisites, you&#8217;ll need to install:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Java 21 JDK (or later)</p>
<div class="paragraph">
<p>Apache Causeway v3 requires Java 17, and the simpleapp itself is currently configured for Java 21.</p>
</div>
</li>
<li>
<p><a href="http://maven.apache.org">Apache Maven</a> 3.9.7+</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If using JDO as the ORM, you&#8217;ll also need to run the Datanucleus enhancer (this post-processes the byte code of the entities).
The <a href="../../../setupguide/latest/about.html" class="xref page">Setup Guide</a> explains how to do this for either IntelliJ and Eclipse.</p>
</div>
<div class="paragraph">
<p>If using JPA as the ORM, the equivalent process to enhancement is performed at run-time, so there are no special setup considerations.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="downloading-running"><a class="anchor" href="#downloading-running"></a>Downloading &amp; Running</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Create a new directory, and <code>cd</code> into that directory.</p>
</div>
<div class="paragraph">
<p>To build the app from the latest stable release:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>if using JDO as the ORM:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl https://codeload.github.com/apache/causeway-app-simpleapp/zip/v3-jdo | jar xv
cd causeway-app-simpleapp-3-jdo
mvn clean install
mvn -pl webapp spring-boot:run</code></pre>
</div>
</div>
</li>
<li>
<p>if using JPA as the ORM:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl https://codeload.github.com/apache/causeway-app-simpleapp/zip/v3-jpa | jar xv
cd causeway-app-simpleapp-3-jpa
mvn clean install
mvn -pl webapp spring-boot:run</code></pre>
</div>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>Either way, this should only take a few seconds to download, compile and run.
Then browse to <a href="http://localhost:8080" class="bare">http://localhost:8080</a>, and read on.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="using-the-app"><a class="anchor" href="#using-the-app"></a>Using the App</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When you start the app, you&#8217;ll be presented with a welcome page from which you can access the webapp using either the generic UI provided by <a href="../../../vw/latest/about.html" class="xref page">Web UI (Wicket viewer)</a> or use Swagger to access the <a href="../../../vro/latest/about.html" class="xref page">REST API (Restful Objects viewer)</a>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/010-root-page.png" alt="010 root page" width="600px">
</div>
</div>
<div class="paragraph">
<p>Choose the generic Wicket UI, and navigate to the login page:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/020-login-to-wicket-viewer.png" alt="020 login to wicket viewer" width="600px">
</div>
</div>
<div class="paragraph">
<p>The app itself is configured to run using <a href="../../../security/latest/about.html" class="xref page">shiro security</a>, as configured in the <code>shiro.ini</code> config file.
You can login with:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>username: <em>sven</em></p>
</li>
<li>
<p>password: <em>pass</em></p>
</li>
</ul>
</div>
<div class="sect2">
<h3 id="wicket-viewer"><a class="anchor" href="#wicket-viewer"></a>Wicket viewer</h3>
<div class="paragraph">
<p>Once you&#8217;ve logged in you&#8217;ll see the default home page:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/030-home-page.png" alt="030 home page" width="600px">
</div>
</div>
<div class="paragraph">
<p>This is a view model annotated with <a href="../../../refguide/latest/applib/index/annotation/HomePage.html" class="xref page">@HomePage</a>:</p>
</div>
<div class="listingblock">
<div class="title">HomePageViewModel.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Named("domainapp.HomePageViewModel")
@DomainObject( nature = Nature.VIEW_MODE )
@HomePage
public class HomePageViewModel {
public String title() { <i class="conum" data-value="1"></i><b>(1)</b>
return return getObjects().size() + " objects";
}
public List&lt;SimpleObject&gt; getObjects() { <i class="conum" data-value="2"></i><b>(2)</b>
return simpleObjects.listAll();
}
@Inject SimpleObjects simpleObjects; <i class="conum" data-value="3"></i><b>(3)</b>
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>identifies or describes the object</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>collection of objects shown on the page</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>automatically injected by the framework</td>
</tr>
</table>
</div>
<div class="sect3">
<h4 id="fixtures"><a class="anchor" href="#fixtures"></a>Fixtures</h4>
<div class="paragraph">
<p>When prototyping against an in-memory database, it&#8217;s useful to have a mechanism to create some initial state.
This can be done using fixture scripts, accessible from the <span class="menuseq"><b class="menu">Prototyping</b>&#160;<i class="fa fa-angle-right caret"></i> <b class="menuitem">Run Fixture Script</b></span>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/032-run-fixture-script-prompt.png" alt="032 run fixture script prompt" width="600px">
</div>
</div>
<div class="paragraph">
<p>This brings up a dialog to select the fixture script:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/033-run-fixture-script-prompt.png" alt="033 run fixture script prompt" width="600px">
</div>
</div>
<div class="paragraph">
<p>The "Domain App Demo" in the drop-down refers to this code:</p>
</div>
<div class="listingblock">
<div class="title">DomainAppDemo.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">public class DomainAppDemo extends FixtureScript {
@Override
protected void execute(final ExecutionContext ec) {
ec.executeChildren(this,
moduleWithFixturesService.getTeardownFixture()); <i class="conum" data-value="1"></i><b>(1)</b>
ec.executeChild(this,
new SimpleObject_persona.PersistAll()); <i class="conum" data-value="2"></i><b>(2)</b>
}
@Inject ModuleWithFixturesService moduleWithFixturesService;
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>uses injected service to tear down all objects.
(Each module provides a teardown script; these are run in the correct sequence).</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Creates new objects</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>When executed, all objects created by the fixture are listed:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/034-run-fixture-script-result.png" alt="034 run fixture script result" width="600px">
</div>
</div>
<div class="paragraph">
<p>Navigating back to the home page shows the newly created objects:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/036-home-page-after-fixture-scriptpng.png" alt="036 home page after fixture scriptpng" width="600px">
</div>
</div>
<div class="paragraph">
<p>As well as running in fixtures from the UI, you can also specify a configuration property to run a fixture script as part of the application start-up:</p>
</div>
<div class="listingblock">
<div class="title">config/application.properties</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-ini hljs" data-lang="ini"># causeway.testing.fixtures.initial-script = \
# domainapp.webapp.application.fixture.scenarios.DomainAppDemo</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="create-an-object"><a class="anchor" href="#create-an-object"></a>Create an object</h4>
<div class="paragraph">
<p>You can also of course create new objects:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/040-create-object-from-menu.png" alt="040 create object from menu" width="600px">
</div>
</div>
<div class="paragraph">
<p>To avoid obscuring the current page, this is configured to bring up a sidebar dialog:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/050-create-object-from-menu-prompt.png" alt="050 create object from menu prompt" width="600px">
</div>
</div>
<div class="paragraph">
<p>Hitting OK returns the created object:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/060-created-object.png" alt="060 created object" width="600px">
</div>
</div>
<div class="paragraph">
<p>The above functionality is implemented by this code (in the <code>SimpleObjects</code> menu domain service):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Action(semantics = SemanticsOf.NON_IDEMPOTENT) <i class="conum" data-value="1"></i><b>(1)</b>
@ActionLayout(promptStyle = PromptStyle.DIALOG_SIDEBAR) <i class="conum" data-value="2"></i><b>(2)</b>
public SimpleObject create(
@Name final String name) { <i class="conum" data-value="3"></i><b>(3)</b>
return repositoryService.persist(SimpleObject.ofName(name));
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Specifying semantics is recommended, as it changes the HTTP method that is used if the action is invoked through the <a href="../../../vro/latest/about.html" class="xref page">REST API</a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Prompt styles such as modal or sidebar can be specified per action, or globally in <code>application.yml</code> file.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The <code>@Name</code> annotation is actually a meta-annotation, meaning that a number of additional semantics (length, layout, validation etc.) are inferred.</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="invoke-an-action"><a class="anchor" href="#invoke-an-action"></a>Invoke an action</h4>
<div class="paragraph">
<p>The <code>SimpleObject</code> contains a couple of properties, and a single action to update that property.</p>
</div>
<div class="paragraph">
<p>The <code>name</code> property is read-only, and can only be modified using the <code>updateName</code> action:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/070-update-name.png" alt="070 update name" width="600px">
</div>
</div>
<div class="paragraph">
<p>The above functionality is implemented by this code (in the <code>SimpleObject</code> entity):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Action(semantics = IDEMPOTENT, commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
@ActionLayout(
associateWith = "name", promptStyle = PromptStyle.INLINE,
describedAs = "Updates the name of this object, certain characters (" + PROHIBITED_CHARACTERS + ") are not allowed."
)
public SimpleObject updateName(
@Name final String name) {
setName(name);
return this;
}
public String default0UpdateName() {
return getName();
}</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="edit-a-property"><a class="anchor" href="#edit-a-property"></a>Edit a property</h4>
<div class="paragraph">
<p>The <code>notes</code> property is editable, and can be edited in-place.
For example:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/080-edit-notes.png" alt="080 edit notes" width="600px">
</div>
</div>
</div>
<div class="sect3">
<h4 id="actions-requiring-confirmations"><a class="anchor" href="#actions-requiring-confirmations"></a>Actions requiring confirmations</h4>
<div class="paragraph">
<p>It&#8217;s also possible to delete an object:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/090-delete-object.png" alt="090 delete object" width="600px">
</div>
</div>
<div class="paragraph">
<p>The viewer displays a message confirming that the object has been deleted:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/100-object-deleted.png" alt="100 object deleted" width="600px">
</div>
</div>
<div class="paragraph">
<p>The above functionality is implemented by this code (in the`SimpleObject` entity):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Action(semantics = NON_IDEMPOTENT_ARE_YOU_SURE) <i class="conum" data-value="1"></i><b>(1)</b>
public void delete() {
final String title = titleService.titleOf(this); <i class="conum" data-value="2"></i><b>(2)</b>
messageService.informUser(String.format("'%s' deleted", title));
repositoryService.removeAndFlush(this);
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Requires the user to confirm the action</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The action&#8217;s implementation uses three services provided by the framework; these are injected into the domain object automatically.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect2">
<h3 id="swagger-restful-objects"><a class="anchor" href="#swagger-restful-objects"></a>Swagger (Restful Objects)</h3>
<div class="admonitionblock caution">
<table>
<tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
if invoking an action using Swagger returns a 401 (unauthorised), then navigate to the REST API directly (<a href="http://localhost:8080/restful" class="bare">http://localhost:8080/restful</a> to authenticate the browser first]).
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Using <span class="menuseq"><b class="menu">Prototyping</b>&#160;<i class="fa fa-angle-right caret"></i> <b class="menuitem">Open Swagger UI</b></span> menu item (or just going back to the home page at <a href="http://localhost:8080">localhost:8080</a>) we can use <a href="https://swagger.io/">Swagger UI</a> as a front-end to the REST API provided by the Restful Objects viewer.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/200-swagger-ui-before-reload.png" alt="200 swagger ui before reload" width="600px">
</div>
</div>
<div class="paragraph">
<p>The public API (where the calling client is assumed to be 3rd party) only exposes view models, not entities.
If the API is private (or for prototyping), then resources corresponding to entities are also exposed:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/210-simpleapp-resources.png" alt="210 simpleapp resources" width="600px">
</div>
</div>
<div class="paragraph">
<p>For example, an object can be created using the resource that represents the <code>SimpleObjects#create</code> action:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/220-create-object-thru-rest-api.png" alt="220 create object thru rest api" width="600px">
</div>
</div>
<div class="paragraph">
<p>The response indicates that the object was successfully created:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/230-create-object-thru-rest-api-response.png" alt="230 create object thru rest api response" width="600px">
</div>
</div>
<div class="paragraph">
<p>The Swagger UI also provides a resource to retrieve any object:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/240-retrieve-object-using-rest-api.png" alt="240 retrieve object using rest api" width="600px">
</div>
</div>
<div class="paragraph">
<p>This results in a representation of the domain object (as per the requested <code>Response Content Type</code>, ie <code>ACCEPT</code> header):</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/using/250-retrieve-object-using-rest-api-response.png" alt="250 retrieve object using rest api response" width="600px">
</div>
</div>
<div class="paragraph">
<p>The Swagger UI is provided as a convenience; the REST API is actually a complete hypermedia API (in other words you can follow the links to access all the behaviour exposed in the regular Wicket app).
The REST API implemented by Apache Causeway is specified in the <a href="http://www.restfulobjects.org">Restful Object spec</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="structure-of-the-app"><a class="anchor" href="#structure-of-the-app"></a>Structure of the App</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The simpleapp starter app is a multi-module project, structured so that you easily extend it as your application grows.</p>
</div>
<div class="sect2">
<h3 id="application-modules"><a class="anchor" href="#application-modules"></a>Application Modules</h3>
<div class="paragraph">
<p>The application consists of five modules:</p>
</div>
<div class="imageblock kroki">
<div class="content">
<object type="image/svg+xml" data="_images/diag-8ab7baff76ffc186da54f47082e4791d011a387e.svg"><span class="alt">simpleapp dependencies</span></object>
</div>
<div class="title">Figure 1. simpleapp dependencies</div>
</div>
<div class="paragraph">
<p>where "&#8230;&#8203;" is either "jdo" or "jpa", depending on the branch.</p>
</div>
<div class="paragraph">
<p>The main business logic resides in <code>module-&#8230;&#8203;-simple</code>, with the <code>webapp</code> module acting as an aggregator.
Each of these modules have unit and/or integration tests.
To allow them to be easily excluded (while prototyping/exploration), they have been placed into their own respective modules.</p>
</div>
<div class="paragraph">
<p>The (non-test) Maven modules each contain exactly one <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html">@Configuration</a> class, residing at the package root for that Maven module.
The location of this class is used for classpath scanning.</p>
</div>
<div class="paragraph">
<p>In a larger application there would likely be many more modules containing these domain object modules.
For example, you might have a <code>module-customer</code> holding a <code>Customer</code> entity and related entities/services, a <code>module-product</code> holding a <code>Product</code> catalog, and a <code>module-order</code> to hold the <code>Order</code>s placed by <code>Customer</code>s:</p>
</div>
<div class="imageblock kroki">
<div class="content">
<object type="image/svg+xml" data="_images/diag-5936d1561be55d4f98b2c97cf62e09251ce1dabf.svg"><span class="alt">Typical application dependencies</span></object>
</div>
<div class="title">Figure 2. Typical application dependencies</div>
</div>
<div class="paragraph">
<p>We can use Maven dependency management to ensure that there are no cyclic dependencies (order "knows about" product but product does not know about orders) and ensure that the codebase remains decoupled.
If Java9 modules become commonplace, we&#8217;ll also be able to restrict visibility of classes between modules.</p>
</div>
</div>
<div class="sect2">
<h3 id="bootstrapping-framework-modules"><a class="anchor" href="#bootstrapping-framework-modules"></a>Bootstrapping &amp; Framework Modules</h3>
<div class="paragraph">
<p>One of the main responsibilities of Spring Boot is - naturally enough - to bootstrap the application.
For the webapp, this is done using a class annotated with <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/SpringBootApplication.html">@SpringBootApplication</a>.
For integration tests, this uses the <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/context/SpringBootTest.html">@SpringBootTest</a> annotation.</p>
</div>
<div class="paragraph">
<p>These two different annotations reference a (class annotated with) <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html">@Configuration</a>, which in turn can <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Import.html">@Import</a> other annotations.</p>
</div>
<div class="paragraph">
<p>By convention, the top-level <code>@Configuration</code> in an Apache Causeway application is called the "app manifest".</p>
</div>
<div class="paragraph">
<p>The <a href="_attachments/simpleapp-modules-dependencies.pptx">diagram</a> below shows how classes fit together:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/simpleapp-modules-dependencies.png" alt="simpleapp modules dependencies" width="800px">
</div>
<div class="title">Figure 3. Module Dependencies</div>
</div>
<div class="paragraph">
<p>(For a JPA branch, the <code>JdoDataNucleus5</code> dependency is replaced by <code>JpaEclipseLink</code>).</p>
</div>
<div class="paragraph">
<p>Let&#8217;s now review the contents of each of the modules in the simpleapp starter app.</p>
</div>
</div>
<div class="sect2">
<h3 id="module-simples-srcmainjava"><a class="anchor" href="#module-simples-srcmainjava"></a>module-&#8230;&#8203;-simple&#8217;s src/main/java</h3>
<div class="paragraph">
<p>Under <code>src/main/java</code> we have:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">src/main/java/
domainapp/ <i class="conum" data-value="1"></i><b>(1)</b>
modules/
simple/ <i class="conum" data-value="2"></i><b>(2)</b>
dom/ <i class="conum" data-value="3"></i><b>(3)</b>
so/ <i class="conum" data-value="4"></i><b>(4)</b>
SimpleObject.java
SimpleObject.layout.xml
SimpleObject.png
SimpleObjectRepository.java <i class="conum" data-value="5"></i><b>(5)</b>
SimpleObjects.java
fixture/ <i class="conum" data-value="6"></i><b>(6)</b>
SimpleObject_persona.java
SimpleObjectBuilder.java
types/ <i class="conum" data-value="7"></i><b>(7)</b>
Name.java
Notes.java
SimpleModule.java <i class="conum" data-value="8"></i><b>(8)</b>
META-INF/
persistence.xml <i class="conum" data-value="9"></i><b>(9)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>For simplicity, all the Java source files reside in a <code>domainapp</code> top-level package.
Change as required.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Top level package for the 'simple' module.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The <code>dom</code> subpackage holds the "domain object model" for this module.
Modules may have other subpackages, common ones include <code>types</code> and <code>fixture</code>s (as below), also <code>api</code>s, <code>contribution</code>s, <code>spi</code>s</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Holds classes for the <code>so</code> ("simple object") entity/aggregate, consisting of the entity definition itself (<code>SimpleObject</code>) and a corresponding domain services (<code>SimpleObjects</code> and <code>SimpleObjectRepository</code>).
The associated <code>.layout.xml</code> and <code>.png</code> are optional but provide metadata/resources for rendering (Maven is configured to also treat <code>src/main/java</code> as a resource location).</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>For the <code>jpa</code> branch only, uses Spring Data JPA to automatically provide the query implementation.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The <code>fixture</code> package contains classes to set up the database to an initial state (as described <a href="#fixtures">earlier</a>.
One of the classes is a <code>FixtureScript</code> (defines <em>how</em> to set up the data) the other is a persona enum (defines <em>what</em> data to set up).</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The <code>types</code> package contains meta-annotations to describe the usage of common value types such as <code>String</code>s.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td><code>SimpleModule</code> is a Spring <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html">@Configuration</a> which allows the domain services and entities of the module to be located.<br>
This is discussed in more detail below.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>For the <code>jdo</code> branch only, the <code>persistence.xml</code> file is required boilerplate.</td>
</tr>
</table>
</div>
<div class="sect3">
<h4 id="simplemodule"><a class="anchor" href="#simplemodule"></a>SimpleModule</h4>
<div class="paragraph">
<p>Every module within an Apache Causeway application should have a module class.
Its purpose is to define a package to scan from, and optionally to declare any transitive dependencies.
In the case of <code>SimpleModule</code>, it consists of:</p>
</div>
<div class="listingblock">
<div class="title">SimpleModule.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package domainapp.modules.simple;
... imports omitted ...
@Configuration
@Import({}) <i class="conum" data-value="1"></i><b>(1)</b>
@ComponentScan <i class="conum" data-value="2"></i><b>(2)</b>
@EnableJpaRepositories <i class="conum" data-value="3"></i><b>(3)</b>
@EntityScan(basePackageClasses = {SimpleModule.class}) <i class="conum" data-value="4"></i><b>(4)</b>
public class SimpleModule
implements ModuleWithFixtures { <i class="conum" data-value="5"></i><b>(5)</b>
@Override
public FixtureScript getTeardownFixture() {
return new TeardownFixtureAbstract2() {
@Override
protected void execute(ExecutionContext executionContext) {
deleteFrom(SimpleObject.class);
}
};
}
@ConfigurationProperties("app.simple-module") <i class="conum" data-value="6"></i><b>(6)</b>
@Data
@Validated
public static class Configuration {
private final Types types = new Types();
@Data
public static class Types {
private final Name name = new Name();
@Data
public static class Name {
private final Validation validation = new Validation();
@Data
public static class Validation {
private char[] prohibitedCharacters = "!&amp;%$".toCharArray();
private String message = "Character '{}' is not allowed";
}
}
}
}
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>This module has no dependencies.
If there were, these would be expressed in terms of module classes (each being a Spring <code>@Configuration</code>)</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>specifies this class' package as a root to scan for Spring <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/stereotype/Component.html">@Component</a>s.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>for <code>jpa</code> branch only, enables Spring Data JPA repositories</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>for <code>jpa</code> branch only, to automatically discover JPA entities</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Optionally, modules can implement the testing&#8217;s <code>ModuleWithFixtures</code> interface.
Through this, they can provide a fixture script which can be used to teardown all entities that are "owned" by the module.
Since the module dependency graph is known, this allows all data to be removed, useful for prototyping and sometimes for integration tests.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Spring Boot <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-typesafe-configuration-properties">type-safe configuration</a>, as per <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/ConfigurationProperties.html">@ConfigurationProperties</a> annotation.
This Spring Boot feature is used by the framework, but can equally easily be used by application code.
The <code>@Name.Specification</code> class uses this configuration property.</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The scanning mechanism is also leveraged by Apache Causeway to pick up three types of classes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>all domain services</p>
<div class="paragraph">
<p>These are classes that are annotated with the framework&#8217;s <a href="../../../refguide/latest/applib/index/annotation/DomainService.html" class="xref page">@DomainService</a> annotation.
Because <code>@DomainService</code> is meta-annotated as a <code>@Component</code>, these are found automatically and are managed by Spring (ie instantiated, injected etc).</p>
</div>
<div class="paragraph">
<p>Depending on their nature, domain services are used to build up the menu, or are available to call programmatically, eg repositories, or sometimes both.</p>
</div>
<div class="paragraph">
<p>In the simpleapp starter app, the only domain service is <code>SimpleObjects</code>.
This appears in the menu, and also acts as a repository for the <code>SimpleObject</code> entity.
The <code>jpa</code> branch also has the <code>SimpleObjectRepository</code> Spring Data service.</p>
</div>
</li>
<li>
<p>all entities.</p>
<div class="paragraph">
<p>These are entities that are annotated with both <a href="../../../refguide/latest/applib/index/annotation/DomainObject.html" class="xref page">@DomainObject</a> annotation and with the ORM-specific annotation.
For <code>jdo</code> branch, this is <code>@javax.jdo.annotations.PersistenceCapable</code>; for the <code>jpa</code> branch this is <code>@javax.persistence.Entity</code>).</p>
</div>
<div class="paragraph">
<p>In the simpleapp starter app, the only entity is <code>SimpleObject</code>.</p>
</div>
</li>
<li>
<p>all fixture scripts</p>
<div class="paragraph">
<p>These are classes that extend from the testing applib&#8217;s <code>FixtureScript</code> class, and are used to setup the database when running in prototype mode (against an in-memory database).</p>
</div>
<div class="paragraph">
<p>As already discussed, the <code>fixture</code> package provides classes to create sample objects, while the <code>SimpleModule</code> provides a fixture script to tear down all data from the module.</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sect2">
<h3 id="module-simple-tests-srctestjava"><a class="anchor" href="#module-simple-tests-srctestjava"></a>module-&#8230;&#8203;-simple-test&#8217;s src/test/java</h3>
<div class="paragraph">
<p>Under <code>src/test/java</code> we have:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">src/test/java/
domainapp/
modules/
simple/
dom/
so/ <i class="conum" data-value="1"></i><b>(1)</b>
SimpleObject_Test.java
SimpleObjects_Test.java
integtests/
tests/ <i class="conum" data-value="2"></i><b>(2)</b>
SimpleObject_IntegTest.java
SimpleObjects_IntegTest.java
SimpleModuleIntegTestAbstract.java <i class="conum" data-value="3"></i><b>(3)</b>
SimpleModuleIntegTestConfiguration.java <i class="conum" data-value="4"></i><b>(4)</b>
src/test/resources/
application-test.yml <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>These are very simple unit tests of <code>SimpleObject</code> and <code>SimpleObjects</code> with the package structure the same as in <code>src/main/java</code>.
They are written in JUnit 5, and use JMockito as the mocking library.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Integration tests for the module.
These use the <a href="../../../refguide/latest/applib/index/services/wrapper/WrapperFactory.html" class="xref page">WrapperFactory</a> to simulate interactions through the UI.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The <code>SimpleModuleIntegTestAbstract</code> superclass bootstraps the module&#8217;s integration tests.
This is discussed in more detail below.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Spring to bootstrap the integration test.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Configuration for the "test" profile</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
these integration tests are annotated with the Spring <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/annotation/Transactional.html">@Transactional</a>, which means that Spring will automatically roll back the changes to the database; there&#8217;s no need to delete data afterwards.
</td>
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
the naming convention&#8201;&#8212;&#8201;with <code>Test</code> and <code>IntegTest</code> suffixes&#8201;&#8212;&#8201;is important, because the Maven surefire plugin is configured to run multiple times, one <code>&lt;execution&gt;</code> for each suffix.
</td>
</tr>
</table>
</div>
<div class="sect3">
<h4 id="simplemoduleintegtestabstract"><a class="anchor" href="#simplemoduleintegtestabstract"></a>SimpleModuleIntegTestAbstract</h4>
<div class="paragraph">
<p>The <code>SimpleModuleIntegTestAbstract</code> is the superclass of all integration tests in the module, annotated with <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/context/SpringBootTest.html">@SpringBootTest</a>:</p>
</div>
<div class="listingblock">
<div class="title">SimpleModuleIntegTestAbstract.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootTest(
classes = SimpleModuleIntegTestAbstract.TestApp.class <i class="conum" data-value="1"></i><b>(1)</b>
)
@ActiveProfiles("test") <i class="conum" data-value="2"></i><b>(2)</b>
public abstract class SimpleModuleIntegTestAbstract
extends CausewayIntegrationTestAbstractWithFixtures { <i class="conum" data-value="3"></i><b>(3)</b>
@Configuration
@Import({
CausewayModuleCoreRuntimeServices.class, <i class="conum" data-value="4"></i><b>(4)</b>
CausewayModuleSecurityBypass.class, <i class="conum" data-value="5"></i><b>(5)</b>
CausewayModuleJdoDataNucleus5.class, <i class="conum" data-value="6"></i><b>(6)</b>
CausewayModuleTestingFixturesApplib.class, <i class="conum" data-value="7"></i><b>(7)</b>
SimpleModule.class <i class="conum" data-value="8"></i><b>(8)</b>
})
@PropertySources({
@PropertySource(CausewayPresets.H2InMemory_withUniqueSchema), <i class="conum" data-value="9"></i><b>(9)</b>
@PropertySource(CausewayPresets.DatanucleusAutocreateNoValidate), <i class="conum" data-value="10"></i><b>(10)</b>
@PropertySource(CausewayPresets.UseLog4j2Test), <i class="conum" data-value="11"></i><b>(11)</b>
})
public static class TestApp {
}
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The <code>TestApp</code> (defined as a nested static class below) lists the modules needed to bootstrap the integration test.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Activates the "test" profile, which reads in additional configuration in `application-test.yml"</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Tests typically inherit from <code>CausewayIntegrationTestAbstract</code>, which provides some convenience methods to inherit from.
In this case, the test inherits from the <code>CausewayIntegrationTestAbstractWithFixtures</code> subclass which also adds in support for running fixtures.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Specifies the modules that make up Apache Causeway framework itself.
These include core, security set to the bypass implementation (effectively is ignored) and JDO/DataNucleus for persistence.
Note that no viewers are bootstrapped because the tests are run through Spring&#8217;s integration testing framework, rather than (say) as Selenium tests.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Disables security checks.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Configures JDO as the ORM.
<div class="paragraph">
<p>If using JPA, this would be <code>CausewayModuleJpaEclipseLink.class</code> instead.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Brings in support for running fixtures.
<div class="paragraph">
<p>You can learn more about testing in the <a href="../../../testing/latest/about.html" class="xref page">Testing Guide</a>.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The module containing the actual business logic to be tested.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>Runs the tests in memory using H2.
A unique schema allows tests to potentially be run in parallel</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>Ensures that JDO/DataNucleus is configured to create the database schema first.
This may be required because the application might otherwise be configured to use the <a href="../../../userguide/latest/flyway/about.html" class="xref page">Flyway integration</a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Sets up logging to use the configuration defined in the <code>log4j2-test.xml</code> file</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect2">
<h3 id="webapps-srcmainjava"><a class="anchor" href="#webapps-srcmainjava"></a>webapp&#8217;s src/main/java</h3>
<div class="paragraph">
<p>Under <code>src/main/java</code> we have:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">src/main/java/
domainapp/
webapp/
application/
fixture/
scenarios/ <i class="conum" data-value="1"></i><b>(1)</b>
DomainAppDemo.java <i class="conum" data-value="2"></i><b>(2)</b>
services/
health/
HealthCheckServiceImpl.java <i class="conum" data-value="3"></i><b>(3)</b>
homepage/
HomePageViewModel.java <i class="conum" data-value="4"></i><b>(4)</b>
HomePageViewModel.layout.xml
HomePageViewModel.png
ApplicationModule.java <i class="conum" data-value="5"></i><b>(5)</b>
custom/
restapi/
CustomController.class <i class="conum" data-value="6"></i><b>(6)</b>
CustomModule.class
quartz/
job/
SampleJob.class <i class="conum" data-value="7"></i><b>(7)</b>
QuartzModule.class
AppManifest.java <i class="conum" data-value="8"></i><b>(8)</b>
SimpleApp.java <i class="conum" data-value="9"></i><b>(9)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Defines scenarios (fixtures) for setting up the system into a known state.
Used for prototyping and also integration testing.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The <code>DomainAppDemo</code> is the fixture that was run <a href="#fixtures">earlier on</a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>An implementation of the <a href="../../../refguide/latest/applib/index/services/health/HealthCheckService.html" class="xref page">HealthCheckService</a>.
This integrates with Spring Boot&#8217;s <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/actuate/health/HealthIndicator.html">HealthIndicator</a> SPI, surfaced through the <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html">Spring Boot Actuator</a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Annotated with <a href="../../../refguide/latest/applib/index/annotation/HomePage.html" class="xref page">@HomePage</a> and so is shown automatically as the home page.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Defines the services in the webapp module, along with dependencies onto the other modules in the application.
<div class="paragraph">
<p>Discussed in more detail below.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Demonstrates how to implement a custom REST controller, accessing the domain object model managed by Apache Causeway.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Demonstrates how to run quartz as a background service, accessing the domain object model managed by Apache Causeway.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td><code>AppManifest</code> is the top-level Spring <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Configuration.html">@Configuration</a> that specifies the components of Apache Causeway to use, along with the modules making up the application itself (ie <code>ApplicationModule</code>, which depends in turn on <code>SimpleModule</code>, and <code>CustomModule</code>).
<div class="paragraph">
<p>This is discussed in more detail below</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td><code>SimpleApp</code> is the <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/SpringBootApplication.html">@SpringBootApplication</a> used to bootstrap the app.
It&#8217;s pretty much boilerplate - the important piece is that it references <code>AppManifest</code>.
<div class="paragraph">
<p>Discussed in more detail below</p>
</div></td>
</tr>
</table>
</div>
<div class="sect3">
<h4 id="applicationmodule"><a class="anchor" href="#applicationmodule"></a>ApplicationModule</h4>
<div class="paragraph">
<p>The <code>ApplicationModule</code> defines the services in the webapp module, along with dependencies onto the other modules in the application.
It&#8217;s very simple though:</p>
</div>
<div class="listingblock">
<div class="title">ApplicationModule.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package domainapp.webapp.application;
... imports omitted ...
@Configuration
@Import(SimpleModule.class) <i class="conum" data-value="1"></i><b>(1)</b>
@ComponentScan <i class="conum" data-value="2"></i><b>(2)</b>
public class ApplicationModule {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>This module depends on the <code>SimpleModule</code> module.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>specifies this class' package as a root to scan for Spring <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/stereotype/Component.html">@Component</a>s.</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="appmanifest"><a class="anchor" href="#appmanifest"></a>AppManifest</h4>
<div class="paragraph">
<p>The "app manifest" is the top-level Spring <code>@Configuration</code>.
It looks like this:</p>
</div>
<div class="listingblock">
<div class="title">AppManifest.java</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Configuration
@Import({
CausewayModuleCoreRuntimeServices.class, <i class="conum" data-value="1"></i><b>(1)</b>
CausewayModuleSecurityShiro.class, <i class="conum" data-value="2"></i><b>(2)</b>
CausewayModuleJpaEclipseLink.class, <i class="conum" data-value="3"></i><b>(3)</b>
CausewayModuleViewerRestfulObjectsJaxrsResteasy4.class, <i class="conum" data-value="4"></i><b>(4)</b>
CausewayModuleViewerWicketViewer.class, <i class="conum" data-value="5"></i><b>(5)</b>
CausewayModuleTestingH2ConsoleUi.class, <i class="conum" data-value="6"></i><b>(6)</b>
CausewayModuleTestingFixturesApplib.class, <i class="conum" data-value="7"></i><b>(7)</b>
CausewayModuleExtFlywayImpl.class, <i class="conum" data-value="8"></i><b>(8)</b>
ApplicationModule.class, <i class="conum" data-value="9"></i><b>(9)</b>
CustomModule.class, <i class="conum" data-value="9"></i><b>(9)</b>
QuartzModule.class, <i class="conum" data-value="9"></i><b>(9)</b>
DomainAppDemo.class <i class="conum" data-value="10"></i><b>(10)</b>
})
@PropertySources({
@PropertySource(CausewayPresets.DebugDiscovery), <i class="conum" data-value="11"></i><b>(11)</b>
})
public class AppManifest {
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Mandatory - specifies the core of the Apache Causeway framework</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enables the Shiro security mechanism.
There are several security implementations, precisely one must be selected</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Enables JPA/Eclipselink for persistence.
<div class="paragraph">
<p>If using JDO as the ORM, replace with <code>CausewayModuleJdoDataNucleus5</code>.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Enables the <a href="../../../vro/latest/about.html" class="xref page">REST API (Restful Objects viewer)</a> (ie REST API).</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Enables the <a href="../../../vw/latest/about.html" class="xref page">Web UI (Wicket viewer)</a></td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Enables the H2 Console (menu from the "Prototyping" menu), applicable only if running against h2 in-memory database.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Brings in support to run <a href="../../../testing/latest/fixtures/about.html" class="xref page">fixtures</a> within the application, eg for prototyping.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>Enables the <a href="../../../userguide/latest/flyway/about.html" class="xref page">Flyway</a> integration.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>References the application&#8217;s module(s), in this case <code>ApplicationModule</code> , <code>CustomModule</code> and <code>QuartzModule</code>.
<div class="paragraph">
<p><code>ApplicationModule</code> is discussed below.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>Makes the fixture scenario classes available for discovery.</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Normally configuration properties are picked up from Spring Boot&#8217;s <code>application.properties</code> or <code>application.yml</code> files, but additional properties can be overridden directly.
These two both use the <code>CausewayPresets</code> convenience class, to disable i18n support and for additional debugging log statements.</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="simpleapp"><a class="anchor" href="#simpleapp"></a>SimpleApp</h4>
<div class="paragraph">
<p>The application is bootstrapped using <code>SimpleApp</code>, a regular <code>@SpringBootApplication</code>.
It is mostly boilerplate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
@Import({
AppManifest.class, <i class="conum" data-value="1"></i><b>(1)</b>
})
public class SimpleApp
extends SpringBootServletInitializer {
public static void main(String[] args) {
CausewayPresets.prototyping(); <i class="conum" data-value="2"></i><b>(2)</b>
SpringApplication.run(
new Class[] { SimpleApp.class }, args);
}
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>references the <code>AppManifest</code> mentioned earlier</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>specifies prototyping mode.
This enables actions marked for prototyping to become available, useful during the early stages of development.
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
As an alternative to making this call, you can also just run with a system property <code>-DPROTOTYPING=true</code>
</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect2">
<h3 id="webapps-srcmainresources"><a class="anchor" href="#webapps-srcmainresources"></a>webapp&#8217;s src/main/resources</h3>
<div class="paragraph">
<p>Under <code>src/main/resources</code> we have:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">src/main/resources
config/
application.properties <i class="conum" data-value="1"></i><b>(1)</b>
application-SQLSERVER.properties <i class="conum" data-value="2"></i><b>(2)</b>
application-POSTGRES.properties <i class="conum" data-value="3"></i><b>(3)</b>
db/
migration/
SQLSERVER/
Vyyyy.mm.dd.hh.ss__xxx.sql <i class="conum" data-value="4"></i><b>(4)</b>
static/ <i class="conum" data-value="5"></i><b>(5)</b>
templates/ <i class="conum" data-value="6"></i><b>(6)</b>
application.yml <i class="conum" data-value="7"></i><b>(7)</b>
banner.txt <i class="conum" data-value="8"></i><b>(8)</b>
log4j2-spring.xml <i class="conum" data-value="9"></i><b>(9)</b>
menubars.layout.xml <i class="conum" data-value="10"></i><b>(10)</b>
shiro.ini <i class="conum" data-value="11"></i><b>(11)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>By convention, we use <code>config/application.properties</code> to hold configuration properties that change between environments (dev, test, prod).
Typically this just holds JDBC connection strings, etc.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enabled if run using the <code>SQLSERVER</code> profile (eg using <code>-Dspring.profiles.active=SQLSERVER</code>). Configures to use a SQL Server database, and enables Flyway to set up the database schema</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Flyway migration scripts.<br>
This leverages a feature in Spring Boot&#8217;s Flyway integration which allows different variants of scripts for different vendors to be stored, in a <code>db.migration.{vendor}</code> package.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The <code>static</code> package (a <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-spring-mvc-static-content">Spring convention</a>) provides access for static resources that are accessible from the webapp</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The <code>templates</code> package holds a fallback error page, which is the <a href="https://www.baeldung.com/spring-thymeleaf-template-directory#change-default">default location</a> for pages rendered using Spring Boot&#8217;s integration with Thymeleaf.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>By convention, we use <code>application.yml</code> to hold configuration properties that do <em>not</em> change between environments.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The <code>banner.txt</code> is shown when bootstrapping.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The <code>log4j2-spring.xml</code> configures log4j2 (the logging system used by Apache Causeway)</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>The <code>menubars.layout.xml</code> arranges the actions of the domain services into menus.</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>The <code>shiro.ini</code> file configures Shiro security integration (see the <code>CausewayModuleSecurityShiro</code> module imported in the <code>AppManifest</code>, above).
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The <a href="#security:shiro:about.adoc" class="xref unresolved">Shiro security</a> integration is much more flexible than simple file-based authentication.</p>
</div>
</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
<div class="paragraph">
<p>To call out some of the files under <code>static</code>:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The <code>index.html</code> is the page shown at the root of the package, providing links to either the Wicket viewer or to the Swagger UI.
In a production application this is usually replaced with a page that does an HTTP 302 redirect to the Wicket viewer.</p>
</li>
<li>
<p>In <code>css/application.css</code> you can use to customise CSS, typically to highlight certain fields or states.
The pages generated by the Wicket viewer have plenty of CSS classes to target.
You can also implement the <code>cssClass()</code> method in each domain object to provide additional CSS classes to target.</p>
</li>
<li>
<p>Similarly, in <code>scripts/application.js</code> you have the option to add arbitrary JavaScript.
JQuery is available by default.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="no-srcmainwebapp"><a class="anchor" href="#no-srcmainwebapp"></a>No src/main/webapp</h3>
<div class="paragraph">
<p>Note that there is no <code>src/main/webapp/</code> or <code>WEB-INF/web.xml</code> - the servlets and filters are configured by Apache Causeway automatically.</p>
</div>
</div>
<div class="sect2">
<h3 id="integration-tests"><a class="anchor" href="#integration-tests"></a>webapp-test&#8217;s src/test/java</h3>
<div class="paragraph">
<p>Under <code>src/test/java</code> we have a number of integration tests,</p>
</div>
<div class="paragraph">
<p>The integration tests are in <code>domainapp.application.integtests</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">src/
test/
java/
domainapp/
webapp/
integtests/
metamodel/
SwaggerExport_IntegTest.java <i class="conum" data-value="1"></i><b>(1)</b>
ValidateDomainModel_IntegTest.java <i class="conum" data-value="2"></i><b>(2)</b>
smoke/
Smoke_IntegTest.java <i class="conum" data-value="3"></i><b>(3)</b>
ApplicationIntegTestAbstract.java <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Exports the Swagger definition file.
<div class="paragraph">
<p>This could then be used to automate generation of client stubs in various languages.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Bootstraps the app and runs the metamodel validators to check that there are not metamodel errors.
<div class="paragraph">
<p>This can also be done simply when running the application, but performing the checks through integration tests enables "fail-fast" checking, as part of CI, for example.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Performs a number of high-level smoke tests, to check that the core functionality works correctly.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Base class used to bootstrap all integration tests for this module.
It is very similar to the base class used to bootstrap the integration tests for the simple module <a href="#simplemoduleintegtestabstract">SimpleModuleIntegTestAbstract</a>, but referencing <code>ApplicationModule</code> rather than <code>SimpleModule</code>.</td>
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The naming convention of tests classes is important, because the starter parent pom <a href="../parent-pom/about.html#surefire-configuration" class="xref page">configures the Maven surefire plugin</a> to execute multiple times, based on test class suffix.</p>
</div>
<div class="paragraph">
<p>The suffixes are: <code>Test</code> (unit tests, if any) and <code>IntegTest</code> (integ tests, if any).</p>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="root-modules-pom-xml"><a class="anchor" href="#root-modules-pom-xml"></a>Root module&#8217;s pom.xml</h3>
<div class="paragraph">
<p>In the parent module we of course have the <code>pom.xml</code>.
This inherits from <code>causeway-app-starter-parent</code>:</p>
</div>
<div class="listingblock">
<div class="title">pom.xml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml">&lt;parent&gt;
&lt;groupId&gt;org.apache.causeway.app&lt;/groupId&gt;
&lt;artifactId&gt;causeway-app-starter-parent&lt;/artifactId&gt;
&lt;version&gt;XXX&lt;/version&gt;
&lt;/parent&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>... which builds upon Spring Boot&#8217;s own <code>org.springframework.boot:spring-boot-starter-parent</code>.
This means:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the set of third party dependencies declared have been validated as compatible by Spring Boot team</p>
</li>
<li>
<p>build plugins are declared and configured appropriately</p>
</li>
<li>
<p>imports to the Apache Causeway dependencies are declared via <code>&lt;dependencyManagement&gt;</code></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="running-from-within-the-ide"><a class="anchor" href="#running-from-within-the-ide"></a>Running from within the IDE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Most of the time you&#8217;ll probably want to run the app from within your IDE.
The mechanics of doing this will vary by IDE; see the <a href="../../../setupguide/latest/about.html" class="xref page">Setup Guide</a> for details.
Basically, though, it amounts to running the <code>main()</code> method in the <code>SimpleApp</code> class.</p>
</div>
<div class="paragraph">
<p>Here&#8217;s what the setup looks like in IntelliJ IDEA:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/simpleapp-webapp.png" alt="simpleapp webapp" width="600px">
</div>
</div>
<div class="paragraph">
<p>If using JDO as the ORM (rather than JPA), then the DataNucleus enhancer must be run beforehand.
With IntelliJ this can be done by setting up a different <em>Run Configuration</em> to be executed beforehand:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/simpleapp-webapp-before-launch.png" alt="simpleapp webapp before launch" width="600px">
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="experimenting-with-the-app"><a class="anchor" href="#experimenting-with-the-app"></a>Experimenting with the App</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once you are familiar with the app, try modifying it.
There is plenty more guidance on this site; start with the <a href="../../../userguide/latest/about.html" class="xref page">User Guide Fundamentals</a> and then look at the other guides linked to from the top-level menu or from the main <a href="../../latest/about.html" class="xref page">table of contents</a>.</p>
</div>
<div class="paragraph">
<p>If you run into issues, please don&#8217;t hesitate to ask for help on the users mailing list or the Slack channel, as per the <a href="../../latest/support/about.html" class="xref page">support page</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="using-an-external-database-and-flywaydb"><a class="anchor" href="#using-an-external-database-and-flywaydb"></a>Using an external database and FlywayDB</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The application is configured by default uses H2 as an inmemory database, with <a href="#fixtures">fixtures</a> used to populate the database with representative data.</p>
</div>
<div class="paragraph">
<p>To deploy to production though of course will require a persistent database, and the schema of the tables will be explicitly managed.
Although both JDO and JPA can automatically create the database schema, many development teams choose to manage the schema externally to the ORM.</p>
</div>
<div class="paragraph">
<p>A popular tool to do this is <a href="https://flywaydb.org/">Flyway</a>, and Spring Boot provides automatic support for it using <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#common-application-properties-data-migration">these configuration properties</a>.</p>
</div>
<div class="paragraph">
<p>The simpleapp demonstrates how this can be done using SQL Server.
Adapt the following for your own preferred database.</p>
</div>
<div class="sect2">
<h3 id="prereqs"><a class="anchor" href="#prereqs"></a>Prereqs</h3>
<div class="paragraph">
<p>If you happen to use SQL Server, then just use a dev instance.
Otherwise, you can easily run up an instance using Docker:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">docker run \
--name sqlserver \
-e 'ACCEPT_EULA=Y' \
-e 'SA_PASSWORD=pa$$w0rd' \
-p 1433:1433 \
-d mcr.microsoft.com/mssql/server:2019-latest</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can then connect:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>if on Linux/Mac, start a command line client using:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">docker exec -it sqlserver \
/opt/mssql-tools/bin/sqlcmd \
-S localhost -U sa -P pa$$w0rd</code></pre>
</div>
</div>
</li>
<li>
<p>if on Windows, you might instead prefer to use Microsoft&#8217;s free GUI client, <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15">SQL Server Management Studio</a>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You then need to create a database and login:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-sql hljs" data-lang="sql">CREATE DATABASE [simpleapp]
go
CREATE LOGIN [simpleapp]
WITH PASSWORD=N'simpleapp',
DEFAULT_DATABASE=[simpleapp],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
go
USE [simpleapp]
GO
ALTER AUTHORIZATION ON DATABASE::[simpleapp] TO [simpleapp]
GO</code></pre>
</div>
</div>
<div class="paragraph">
<p>If using the command line, type 'exit' to quit out.</p>
</div>
<div class="paragraph">
<p>To confirm the connect, try logging in as simpleapp/simpleapp, and verify using:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-sql hljs" data-lang="sql">select db_name(), user_name()
go</code></pre>
</div>
</div>
<div class="paragraph">
<p>This should return <code>simpleapp</code> and <code>dbo</code> respectively, meaning that the <code>simpleapp</code> login is all-powerful in the <code>simpleapp</code> database.</p>
</div>
</div>
<div class="sect2">
<h3 id="enabling-flyway"><a class="anchor" href="#enabling-flyway"></a>Enabling Flyway</h3>
<div class="paragraph">
<p>With the backend database running, we can now run the simpleapp application with Flyway enabled.
This is done simply by activating the "SQLSERVER" profile (see also the <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-profiles">Spring docs</a>):</p>
</div>
<div class="ulist">
<ul>
<li>
<p>either by setting a system property:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">-Dspring.profiles.active=SQLSERVER</code></pre>
</div>
</div>
</li>
<li>
<p>or by setting an environment variable:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">export SPRING_PROFILES_ACTIVE=SQLSERVER</code></pre>
</div>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>This will cause Spring to read in the <code>config/application-SQLSERVER.properties</code> file:</p>
</div>
<div class="listingblock">
<div class="title">config/application-SQLSERVER.properties</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">spring.flyway.enabled=true
spring.flyway.default-schema=SIMPLE
spring.flyway.schemas=SIMPLE
spring.sql.init.platform=sqlserver
spring.datasource.url=jdbc:sqlserver://localhost;databaseName=simpleapp
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.username=simpleapp
spring.datasource.password=simpleapp
#causeway.persistence.schema.create-schema-sql-template= (use flyway instead)
causeway.persistence.schema.auto-create-schemas=
# DataNucleus, and must use camelCase rather than kebab-case
datanucleus.schema.autoCreateAll=false</code></pre>
</div>
</div>
<div class="paragraph">
<p>Flyway in turn reads the migration scripts under <code>db.migration</code> package (in <code>src/main/resources</code> of the <code>webapp</code> module).</p>
</div>
<div class="paragraph">
<p>Run up the application and Flyway will run in the scripts.
It will also create its own table, <code>SIMPLE.flyway_schema_history</code>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/simpleapp/flyway/tables-created.png" alt="tables created" width="300px">
</div>
</div>
</div>
<div class="sect2">
<h3 id="cleaning-up"><a class="anchor" href="#cleaning-up"></a>Cleaning up</h3>
<div class="paragraph">
<p>If you were using Docker to try this out, remember to clean up afterwards:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">docker kill sqlserver
docker rm sqlserver</code></pre>
</div>
</div>
</div>
</div>
</div>
</article>
<aside class="article-aside toc hide-for-print" role="navigation">
<p class="toc-title">On this page</p>
<div id="article-toc"></div>
</aside>
</main>
</div>
<footer class="footer">
<div class="content">
<div class="copyright">
<p>
Copyright © 2010~2024 The Apache Software Foundation, licensed under the Apache License, v2.0.
<br/>
Apache, the Apache feather logo, Apache Causeway, and the Apache Causeway project logo are all trademarks of The Apache Software Foundation.
</p>
</div>
<div class="revision">
<p>Revision: build-website.20251118-0002</p>
</div>
</div>
</footer>
<script src="../../../_/js/site.js"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
<script src="../../../_/js/vendor/jquery-3.4.1.min.js"></script>
<script src="../../../_/js/vendor/jquery-ui-1.12.1.custom.widget-only.min.js"></script>
<script src="../../../_/js/vendor/jquery.tocify.min.js"></script>
<script>
$(function() {
$("#article-toc").tocify( {
showEffect: "slideDown",
hashGenerator: "pretty",
hideEffect: "slideUp",
selectors: "h2, h3",
scrollTo: 120,
smoothScroll: true,
theme: "jqueryui",
highlightOnScroll: true
} );
});
</script>
<script src="../../../_/js/vendor/docsearch.min.js"></script>
<script>
function focusSearchInput () { document.querySelector('#algolia-search-input').focus() }
var search = docsearch({
appId: '5ISP5TFAEN',
apiKey: '0fc51c28b4ad46e7318e96d4e97fab7c',
indexName: 'causeway-apache-org',
inputSelector: '#algolia-search-input',
autocompleteOptions: { hint: false, keyboardShortcuts: ['s'] },
debug: false,
}).autocomplete
search.on('autocomplete:closed', function () { search.autocomplete.setVal() })
focusSearchInput()
window.addEventListener('load', focusSearchInput);
</script>
<!--
docsearch options:
https://docsearch.algolia.com/docs/behavior/
-->
<!--
https://www.algolia.com/doc/api-reference/api-parameters/
algoliaOptions: { hitsPerPage: 6 },
-->
</body>
</html>