Sunday, July 24, 2016

Serving Oracle JET Application from WebLogic

Oracle JET application can be served from WebLogic as static content (HTML/JavaScript), JET code will be downloaded and executed on the client. Read more about packaging and deploying JET applications in developer guide - Packaging and Deploying Web Applications.

Here is demo JET application served on WebLogic server, port 7101. JET index.html page is referenced through application context root, registered on WebLogic during deployment of static content:


Required steps:

1. Generate JET application from basic template (use sudo on Mac OS):

yo oraclejet RSJETDemoApp --template=basic

2. Navigate to JET application folder and run grunt command to generate minified JET app structure under release folder:

grunt build:release


Grunt creates release structure and updates JS content, main.js contains merged JS content:


3. In order to serve JET as static content from WebLogic, we need to add WEB-INF folder and web.xml file. This will allow to deploy it as application to WebLogic. Create web.xml file with empty structure:


4. Final structure should look like this, web.xml and WEB-INF folder inside release:


5. Go to WebLogic Console and in deployment screen navigate to folder location, where release is located:


6. As for any other Web application deployment, choose Install this deployment as an application:


7. Provide application name and specify deployment accessible for the folder location:


8. Deployment should be completed without errors:


There is no other job for the server as to transfer HTML and JavaScript to the client. Code is running on the client.

4 comments:

Unknown said...

Andrejus,
I am able to create a project using the command below:

yo oraclejet newproject --template=navdrawer

And then i can build the project without any errors using the command below:

grunt build:release

But the "release" folder is not created. Any thoughts/suggestions?

Thanks in advance,
Serdar

Anonymous said...

Serdar - the release output in JET 2.2.0 goes in the web folder. There's a WEBINF folder created for you there when you do a grunt build:release

Joe D G said...

HI Andre,
This no longer works as of May 26, 2017 - grunt build:release does not create the webinf folder or release folder. Also from your folder structure, specifically nbproject - looks like you built this in NetBeans.

Andrej Baranovskij said...

WEB-INF folder must be created manually. JET generates WEB folder, copy content to Web app with WEB-INF and with empty web.xml

Andrejus