error in code compiling

Hi this is the error i am getting while compiling

C:\>javac SessionListener.java

SessionListener.java:17: <identifier> expected

privatestatic Map<String,HttpSession> sessionMX =new HashMap<String,HttpSe

ssion>();

^

SessionListener.java:60: <identifier> expected

publicstatic Set<String> getActiveSessionids(){

^

SessionListener.java:118:';' expected

^

3 errors

this is the code which i am compiling so can you suggest me something....

thanks in advance

package com.listeners;

import java.util.Map;

import java.util.HashMap;

import java.util.Collections;

import java.util.Set;

import javax.servlet.http.HttpSession;

import javax.servlet.http.HttpSessionListener;

import javax.servlet.http.HttpSessionEvent;

publicclass SessionListenerimplements HttpSessionListener{

/*Usage of a Static Collection Object is what the other Poster is talking about*/

privatestatic Map<String,HttpSession> sessionMX =new HashMap<String,HttpSession>();

/*Called @time when a new session is created */

publicvoid sessionCreated(HttpSessionEvent se){

HttpSession session = se.getSession();

sessionMX.put(session.getId(),session);

}

/*Called @time when an existing session is being destroyed */

publicvoid sessionDestroyed(HttpSessionEvent se){

HttpSession session = se.getSession();

sessionMX.remove(session.getId());

}

/* Utility Methods */

/**

* Returns number os active sessions

*

**/

publicstaticint getNoActiveSessions(){

return sessionMX.size();

}

/**

* Returns a Set of Active SessionIds

*

**/

publicstatic Set<String> getActiveSessionids(){

return sessionMX.keySet();

}

/**

* Returns whether there is any Active Session or not

*

**/

publicstaticboolean isActive(String sessionId){

return sessionMX.containsKey(sessionId);

}

/**

* Returns associated session for specified sessionID

* if not found returns 'null'

*

**/

publicstatic HttpSession getAssociatedSession(String sessionId){

HttpSession session =null;

if(isActive(sessionId))

session = sessionMX.get(sessionId);

return session;

}

/**

* Invalidates the specified session with consequent sessionID

* returns true if succeful else returns false

*

**/

publicstaticboolean force2Invalidate(String sessionId){

boolean flag =false;

if(isActive(sessionId)){

sessionMX.get(sessionId).invalidate();

flag =true;

}

return flag;

}

}

[5181 byte] By [hunterzza] at [2007-11-27 4:52:26]
# 1
What version of the javac compiler are you using? To use generics it needs to be 1.5 or later
georgemca at 2007-7-12 10:06:27 > top of Java-index,Core,Core APIs...