Deploy a DoneJS App to a J2EE Container

All,

I am looking for a How To Guide to deploy a DoneJS App w/Server-Side Rendering to a J2EE container like Tomcat or Weblogic.

Any assistance/information is greatly appreciated!

Thanks

I don’t know enough about the Java stack to be confident in what I’m talking about. With that in mind …

Would a J2EE container support node? I think something like Tomcat only supports JRE applications. If instead you’re using Tomcat more like Apache / Nginx, it can be used as a reverse proxy to the node server-side rendering process.

DoneJS is intended to be used alongside a Java based service layer. But it won’t run within it. You need to host a node process.

To shed a little more light on this …

DoneJS apps are written as “pure” browser applications. Meaning, they can run totally fine in a browser, without needing any special backend technology. They are written as “single page applications”. Another term is “thin server architecture”. Basically, client-side JavaScript loads all the data via AJAX, and creates all the HTML.

The AJAX requests can go to restful services built in anything: J2EE, python, ruby, perl, etc.

However, there are NodeJS based utilities/libraries that DoneJS uses. For example, its build system that combines and minimizes every JS and CSS file your application uses. It also has generators that help reduce boilerplate.

Finally, DoneJS includes a project can-ssr, that can load a DoneJS “client” application in NodeJS and render it.

So, the usual setup is to run a node server that hosts the “server side rendering” next or near to your application/data servers. Your application servers might be hosted under /api. The “server side rendering” should respond to all other requests. A reverse-proxy might sit above the application server and “server side rendering server”, proxying to them based on the incoming url.

I basically think of the “server side rendering server” as a service. You give it your app, where the users is going to, it will send back the html. Ideally, you never have to write any specific code for it.

Justin,

Thanks for the information/clarification.

As I stepped through the Chat Guide, I was under the impression that we had to deploy to a NodeJS server…
Sounds like NodeJS is being used more to help out with development and code generation.

I appear to missing a little bit on the glue here…
B/c of hosting resources we have, we need to stick to the following Pattern:

  1. Apache Serves up the Static content (file: css, js, html, …)
  2. J2EE Container provides the RESTful services.

On the Chat example (basic hello world), I have done the following steps:

  1. Run: donejs init
  2. Run: npm install bootstrap --save
  3. Run: donejs build

The build creates the following in sub folder: dist

±–bundles
| ±–donejs-char
| | index.css
| | index.js
| |
| —util
| —vdom
| vdom.js
|
—node_modules
—steal
steal.production.js

My confusion is what file is used to identify the resources the browser should request/load for things to work…
Or is there some build option(s) that I should be using if deploying an App to Apache?

Again, Thanks for the information/assistance!

1 Like