This Cookbook entry is intended to be a one-page intro to Java Handlers.
The Handler architecture for Groovy and PHP is “built in” to sMash by convention, in that the handler scripts live in <app_name>/app/resources and are automatically invoked when a matching inbound url request for http://server:port/resources/resource_name is received. Java handlers are equally viable, [...]
Nginx as a proxy server to sMash
Posted by zhuke on May 6th, 2010. Other posts by zhuke
Configure nginx as proxy server to sMash application.
This is a very simple example of using the restToSoap extension of the WebSphere sMash Connection API with a php-based client app to invoke a remote web service. We have not implemented any of the PHP SOAP libraries yet for WebSphere sMash, but this example shows the relative ease in which a PHP script can [...]
Logging from a PHP script
Posted by cjthorne on December 3rd, 2009. Other posts by cjthorne
When I am writing a PHP script I often want to write to the WebSphere sMash log or trace files. Using the Java Bridge I have written a simple PHP script that I can include in my PHP scripts and use to log to these files. I can then control the level of logging by [...]
DataGrid and JsonRestStore with ZRM (Part 3)
Posted by fraenkel on August 10th, 2009. Other posts by fraenkel
This is the final installment of this series on ZRM and the DataGrid. This final chapter will cover how to CREATE and UPDATE entries. The first two blogs covered the READ and DELETE operations.
We will be creating a Form from the Model, placing the form on the page and wiring the Grid to the Form. [...]
DataGrid and JsonRestStore with ZRM (Part 2)
Posted by fraenkel on August 10th, 2009. Other posts by fraenkel
Now that we have a DataGrid that shows the values of a Zero Resource Model (see first blog), lets further enhance this example with a simple delete action.
The idea is simple, we delete the selected rows once the Delete button is pressed (clicked). Rather than delete the items from the Grid, we will instead remove [...]
How to deploy sMash with the WebSphere Proxy
Posted by Mandar on August 5th, 2009. Other posts by Mandar
sMash clusters can be deployed using WebSphere Proxy server by configuring them in Generic Server Clusters.
Consider the following apache mod_proxy configuration that defines a cluster identified by context root “/forum”. The cluster has 2 members.
Let us assume that the sMash back ends have been configured as described in Proxy Configuration with apacheRouteID
<Proxy [...]
Using DataGrid and JsonRestStore with ZRM
Posted by fraenkel on August 3rd, 2009. Other posts by fraenkel
In the days of sMash 1.1.1, to provide visualization of a Zero Resource Model (ZRM), you needed to use the ZRM DataGrid and ZRM Store. It is now possible to use the DataGrid and JsonRestStore from Dojo 1.2 instead.
NOTE: To follow these steps you must be using a post sMash 1.1.1 build like monza [...]
How to deploy sMash with WebSphere VE
Posted by Mandar on July 30th, 2009. Other posts by Mandar
There are several ways to deploy sMash with WebSphere VE depending on what you are looking for.
Here I address routing to multiple sMash instances (sMash cluster) with session affinity. The sMash documentation describes how to do this using Apache / mod_proxy.
If you have WebSphere VE, which is a far more capable proxy than Apache/mod_proxy, it [...]
Rewriting URLs in Websphere sMash
Posted by timpreece on July 30th, 2009. Other posts by timpreece
Many PHP applications require mod_rewrite to manipulate URL’s on the fly. The Apache mod_rewrite module allows you to define a set a regular expression patterns to modify URLs. In WebSphere sMash it is possible to manipulate URLs in the same way in a requestBegin event handler.
For example:
In zero.config add a requestBegin event handler to process [...]

