This chapter contains the following information:
Introduction to Jaggery
Jaggery is a framework to write Web applications and HTTP-focused Web services purely in Java Script, for all aspects of the application: front-end, server-side logic, communication and persistence. It is 100% open source and delivered under Apache license 2.0.
There is a myriad of different front-end and back-end technologies with multiple levels of data communication involved in Web development today. The biggest challenge in working with a pool of different technologies is preserving information integrity and consistency when it is passed through and converted from one technology to another. Jaggery successfully addresses most of these challenges.
Given below are some of the main features and capabilities of Jaggery.
- Jaggery is developed on top of the component-based WSO2 Carbon platform, which is the award-winning enterprise run-time for application and Web service hosting. It consists of just the right set of components required for efficient functioning. As a result, Jaggery is lean and lightweight.
- Because of its component-based architecture, Jaggery can be easily provisioned by plugging in additional component to it.
- Jaggery is also cloud-enabled, which will soon be available with WSO2 Stratos for public and private cloud deployments, allowing users Web development and deployment capability on the Cloud.
- Jaggery talks smoothly in JSON. Clients can instantly send JSON information to the server and the application is capable of understanding the data format
- Jaggery has embedded URL pattern recognition and pattern matching libraries. Being able to handle URL patterns is a useful feature in Web application and API development.
- In-built capability to communicate with databases such as embedded H2, MySQL, Oracle etc.
- Jaggery scripts can be executed through a shell, which assists debugging.
For more information on Jaggery, a quick-start guide, samples, documentation and a hands-on experience of this evolving product, go to http://jaggeryjs.org.
Deploying Jaggery Applications
WSO2 supports Apache tomcat based Jaggery application deployment through the following feature in the WSO2 feature repository:
Name: WSO2 Carbon - Jaggery Server Feature
If Jaggery application management capability is not included in your product by default, you can add it by installing the above feature using the instructions given in section Feature Management. This feature is bundled by default in the WSO2 Application Server (version 5.0.0 onwards).
Before deploying a Jaggery application through the Management Console, bundle it as a '.zip' archive with all the Jaggery application-related resources and third-party libraries.
Follow the instructions below to deploy the file in a running Carbon instance.
1. Log on to the product's Management Console. Click "Add" under menu "Jaggery Applications ."
2. The "Upload Jaggery Applications" page appears. Select your file and click "Upload."
If you want to add multiple services at the same time, click on the '+' sign next to the "Browse" button.
3. If the Jaggery application was deployed successfully, a message appears saying it was successful and the "Running Applications" window opens. For example,
If the Jaggery application is faulty, a "Faulty Jaggery Application Groups" link will appear. You can click the link to view the errors.
Instead of using the Management Console, you can manually place the
.zip file in
<PRODUCT_HOME>/repository/deployment/server/jaggeryapps and it will be deployed. Instead of creating a zip file, you can also add the resource files such as style sheets, images, java scripts etc. in the said location (preferably within a folder) along with the index.jag file. The files will be auto deployed.