private void listen( HttpServletRequest request, HttpServletResponse response ) {
		RequestDispatcher 	dispatcher	= null;
		ChatClientHelper	helper		= null;
		int					action		= 0;
		
		try {
			if( request.getParameter( "action" ) == null ){
				logger.info( "No action parameter, redirecting to default action" );
				action = Definitions.DEFAULT_ACTION;
			}else{
				action = Integer.parseInt( request.getParameter( "action" ) );
			}
		} catch ( NumberFormatException e ){
			logger.error( "Wrong action parameter, redirecting to error 404" );
			action = Definitions.ERROR_404;
		} catch ( Exception e ){
			logger.error( "System failure, redirecting to error 500" );
			logger.error( "Unknown error", e );
			action = Definitions.ERROR_500;
		}
		
		try{ 
			helper = new ChatClientHelper( );
			helper.dispatch( request, response, action );
			dispatcher = request.getRequestDispatcher( "jsp/redirect.jsp" );
			dispatcher.forward( request, response );
		} catch ( ServletException e ) {
			logger.error( "?:SERVLETERROR", e );
		} catch ( IOException e ) {
			logger.error( "?:IOERROR", e );
		} catch ( Exception e ){
			logger.error( "?:ERROR", e );
		}
	}