Isomorphic (Universal) Ozark ReactJS ViewEngine Demo
To establish the use of React.JS on the Java server-side, I created a
ViewEngine implementation for Ozark/MVC 1.0, which uses the server-side rendering option of React.JS.
MVC 1.0 is at a very early stage and this project uses snapshot versions of Ozark. So there might be some not yet known effects/troubles when running the application.
For your convenience, this project comes with all dependencies which are needed to run the application in a pure servlet-container like Apache Tomcat or Jetty. So you don't have to rely on your container to provide all of the technology and libraries (Ozark itself is yet developed for Glassfish only, but this might (hopefully) change in the future).
This project is Gradle based and comes with a Gradle Wrapper, so you don't have to have Gradle installed on your machine. To build the WAR file, just type
$ ./gradlew build
in your console/terminal. This will build a
ozark-react.war in the
For your convenience, also a Maven
pom.xml file is available.
For this reason, I use Webpack with integrated Babel.js to transpile the JSX/ES6 components into executable JS (ES5) code and bundle it together with React.JS into one app file. This file is then used within the application at runtime (server- and client-side).
Also, if this means that you have two different build tools (like Gradle and NPM here) for one project, the configuration and result of the tools is much better than trying something else. Luckily, it's easily possible, to start the NPM tasks from within the Gradle build process, so it won't become pain in the ass to run both when needed.
Class Diagram / Data Flow
This diagram gives you a rough overview of how the related classes depend on each other, resp. are communicating with each other (it's no correct UML syntax!).
Contribution / Issues
Don't hesitate to contribute to this project in any kind of sending PRs for improvements, enhancements, and/or bug-fixes.
I appreciate every issue that will be reported.