O'Reilly logo

JBoss AS 7 Configuration, Deployment, and Administration by Francesco Marchioni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing mod_cluster

Having completed and verified the installation of mod cluster, we can now test it with minimal web application. The sample application packaged as balancer.war contains simply an index.jsp page, which dumps a message on the console.

<%
Integer counter = (Integer)session.getAttribute("counter");
if (counter == null) {
session.setAttribute("counter",new Integer(1));
}
else {
session.setAttribute("counter",new Integer(counter+1));
}
System.out.println("Counter"+session.getAttribute("counter"));out.println("Counter "+session.getAttribute("counter"));
%>

Now, open your browser and point to the httpd proxy address we have configured at:

http://192.168.10.1:8888/balancer

As you can see, mod cluster follows the sticky session policy; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required