Posts Under 'Tutorials'

java.lang.IllegalStateException in Java Servlet

When response.sendRedirect() is not the last statement in Servlet to be executed and its embedded in between your business logic i.e after response.sendRedirect(), if some function or business logic is continued this exception will be thrown by the java servlet. So, it should be the last statement otherwise it should return null after redirecting. eg. […]

Read more »


How to Format Floating Point Number in Java

public DecimalFormat(String pattern) Creates a DecimalFormat using the given pattern and the symbols for the default locale. This is a convenient way to obtain a DecimalFormat when internationalization is not the main concern. To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the […]

Read more »


How to set the session timeout in tomcat higher

You can specify the timeout of a session in the deployment descriptor of your web application (web.xml): <web-app> <session-config> <session-timeout>60</session-timeout> </session-config> … </web-app> The number within the session-timout element must be expressed in minutes.

Read more »


Integrating Apache 1.3.x and Tomcat 4.x with mod_jk on Linux

This FlashGuideTM covers integrating Apache 1.3.x and Tomcat 4.x on Unix via mod_jk. These instructions have been tested on SuSE 9.0, Red Hat 6.2 and Fedora Core 2. There are two ways to integrate Apache and Tomcat: mod_jk and mod_jk2. Mod_jk is the older but more stable version, which supports load balancing and non-standard web […]

Read more »


Apache performance tips

If Apache 2.0 is running on several Linux boxes behind a load balancer, here are a couple of things you can do to speed things up. 1. Disable RedirectMatch directives temporarily 2. Increase MaxClients and ServerLimit This is a well-known Apache performance optimization tip. Its effect is to increase the number of httpd processes available […]

Read more »