Concurrent Session Control in Spring

I am using Spring Acegi for my application security. It is amazing. It works perfectly fine and also very open for customization. Recently, there is a request from the customer to disallow concurrent sessions. I thought it may be a challenge but yet again, it prove that I have made the right choice:

After googling for a couple of minutes I found this

http://static.springsource.org/spring-security/site/docs/2.0.x/reference/ns-config.html#ns-concurrent-session

So add:

<listener>
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
</listener>

and

<http>
<concurrent-session-control max-sessions=”1″ exception-if-maximum-exceeded=”true”/>
</http>

to web.xml

And that’s it. Everything is running smoothly after restarting the app server.

Posted in Uncategorized.


Spring applicaion context access from backend system

It is something very simple when you know how it work. My application is based on Spring / Strut but also have some component to received SMS from end-user.

When the customer log in through the web interface the application context is set. But when an SMS is received the SMS Controller will need to access the beans. it will be good if there a way for me to access the application context. import

org.springframework.context.ApplicationContext;

import org.springframework.context.ApplicationContextAware;

 public class AppContext implements ApplicationContextAware{

public static ApplicationContext ctx;

 public void setApplicationContext(

      ApplicationContext applicationContext) {

     ctx = applicationContext;

    }

 }

 and in the applicationContext.xml add: and whenever you need to get a bean object:

UserManager userManager = (UserManager) AppContext.ctx.getBean(“userManager”);

Posted in Java, Spring.


Joomla tutorials 1: Introduction

Joomla! is a content management system  open source. Joomla! is written in PHP and connects to MySQL database, allowing users to easily publish content  their Internet or Intranet.

Joomla! have the basic characteristics are: buffer page (page caching) to speed display, indexing, RSS feed reader (RSS feeds), pages to print, copy, news flashes, blogs, forums, vote , calendars, website searching, and multilingual support.

Joomla! pronounced by the Swahili as jumla means “concerted force.”

Joomla! used everywhere in the world, from personal websites to enterprise systems website is highly complex, offers many services and applications. Joomla! can be easily installed, easily managed and highly reliable.

Joomla! is open source so the use of Joomla! is free for everyone in the world.

Currently Joomla! has two main line version:

* Joomla! 1.0.x version first generation (stable)
o released the first version: Joomla! 1.0.0 (September 15, 2005)
o released the latest version: Joomla! 1.0.15 (February 22, 2008)
* Joomla! 1.5.x: second-generation version (stable)
o The old version (development stage): Joomla! 1.5 Beta, Joomla! 1.5 RC1, Joomla! 1.5 RC2, Joomla! 1.5 RC3, Joomla! 1.5 RC4
o released the latest version: Joomla! 1.5.11 (dated 03 May 2009 06)

You can download joomla from  http://www.joomla.org/download.html

In later tutorials, we will only work with Joomla 1.5.x

Appointment to see you again at the second tutorial 2:  Joomla : Setup

Posted in Technologies, php.

Tagged with , .


Page 4 of 41234