Showing posts with label J2EE. Show all posts
Showing posts with label J2EE. Show all posts

Tuesday, October 7, 2014

Creating Simple Weblogic JMS Queues

In this post, we'll be seeing how to create a simple JMS queue in Weblogic application server. Based on the queues created in this tutorial, new tutorials will be posted in the future on how to listen and send message to a JMS queue.

1.  Steps to create a JMS Server




4.  Create JMS Queues and Connection Factory

4.1    Create Connection Factory

    Author: Thiagu

Wednesday, February 4, 2009

Setting Session Timeout (J2EE)

There are two ways of setting session timeout in Java. One is by utilizing the deployment descriptor and the other is by calling setMaxInactiveInterval() under HttpSession interface.

Using Deployment Descriptor:



Setting time-out at the deployment descriptor gives impact to the whole web-application. Looking at the example above, the session for the whole web application will terminate in 5 minutes (note: In deployment descriptor the time used for the timeout is measured in minutes)


Using setMaxInactiveInternal() :

HttpSession session = request.getSession() ;
session.setMaxInactiveInterval( 5 * 60) ;

The difference between using setMaxInactiveInterval() in a program and using in deployment descriptor are:

  • setMaxInactiveInterval() method will only cause session time-out for a particular session instance and not the whole web-application.
  • Other than that in setMaxInactiveInterval() method, time is measured in seconds not minutes. Take a look at the code above, to reach 5 minutes expiry (5*60) is used.

Author: Thiagu