1 Minute Tutorial


Please download the latest version of buffalo distribution. Create a directory structure as follows:


Copy commons-logging.jar, buffalo-version.jar to WEB-INF/lib, copy prototype.js, buffalo.js to script.

Edit web.xml

Create a web.xml in WEB-INF with content as follow:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<display-name>Buffalo Example Application</display-name>

Edit buffalo-service.properties

Create a text file buffalo-service.properties to WEB-INF/classes with content as follow:

# Example Service

Edit JSP file

Create example.jsp in the web root:

<meta http-equiv="Content-Type" content="text/html">
<script language="javascript" src="script/prototype.js"></script>
<script language="javascript" src="script/buffalo.js"></script>
<script language="javascript">
var END_POINT="<%=request.getContextPath()%>/bfapp";
var buffalo = new Buffalo(END_POINT);
function hello() {
    var p1 = $("myname").value;
    buffalo.remoteCall("helloService.hello",[p1], function(reply) {
    <p>Buffalo Hello World</p>
    <form name="form1" method="post" action="">
      Your name: 
      <input name="myname" type="text" id="myname">
      <input type="button" name="Submit" value="Hello" onclick="hello()">

Adding a Service

package example;
public class HelloService {
public String hello(String name) {
  try {
    // to see the loading status
  } catch (InterruptedException e) {
  return "Hello, " + name;

Compile it and copy the binary class file to WEB-INF/classes.

Final step: run the application

Copy the whole buffalo-exmaple directory to TOMCAT_HOME/webapps, start tomcat, open browser and visit http://localhost:8080/buffalo-example/example.jsp, input your name and click "Hello" button, see the result.

Further more

Please read spring integration and best practice for more information