# Deploy a DoneJS App to a J2EE Container

**URL:** <https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138>\
**Category:** Uncategorized\
**Created:** [January 27, 2016, 3:29pm UTC](https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138 "2016-01-27T15:29:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [January 27, 2016, 3:29pm UTC](https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138/1 "2016-01-27T15:29:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [January 27, 2016, 3:49pm UTC](https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138/2 "2016-01-27T15:49:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [January 27, 2016, 4:04pm UTC](https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138/3 "2016-01-27T16:04:24Z")

</div>

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](https://github.com/canjs/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.

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [January 28, 2016, 6:45pm UTC](https://forums.bitovi.com/t/deploy-a-donejs-app-to-a-j2ee-container/138/4 "2016-01-28T18:45:50Z")

</div>

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!
