Hello,
I use Eclipse as my IDE. I can compile & build_war no problem on the following piece of code. But I notice that there is a warning when I bring my mouse beside this line, the warning says " The static method getIncidentId(Persistent Session) from the type SessionInfo should be accessed in a static way.
this is the line where the warning shows up...
incidentId = sessionInfo.getIncidentId(session);
what should I do to resolve this?
thanks,
Ngai
===========================================================
protected ControllerResponse runActivateCDKState(ControllerRequest request,
ControllerResponse response)
throws ControllerException {
if (log.isDebugEnabled()) {
log.debug("BEGIN: runActivateCDKState");
}
if (!checkSession(request, response)) {
return (response);
}
/*
* get data from the user session
*/
String incidentId = null;
SessionInfo sessionInfo = new SessionInfo();
PersistentSession session = request.getSession();
try {
incidentId = sessionInfo.getIncidentId(session);
} catch (ServletException ex) {
log.error("Exception: error accessing user's session information.");
log.error("Exception: " + ex.getMessage());
}
String team = null;
try {
NotificationDBO dboNotif = new NotificationDBO();
dboNotif.setDBName(request.getDBName());
boolean bActive = dboNotif.doActivate(false, team, incidentId);
if (bActive) {
if (log.isDebugEnabled()) {
log.debug("END: runActivateCDKState - Successful!");
}
} else {
ErrorCollection ec = new ErrorCollection();
ec.addError("Error activating CDK team.");
response.saveErrors(ec);
log.error("Error activating CDK team.");
if (log.isDebugEnabled()) {
log.debug("END:.....................runActivateCDKState - Unsuccessful!");
}
}
} catch (DBException dbex) {
log.error("Exception: runActivateCDKState(): " + dbex.getMessage());
}
//end catch
runMemberStatsState(request, response);
return (response);
}
I use Eclipse as my IDE. I can compile & build_war no problem on the following piece of code. But I notice that there is a warning when I bring my mouse beside this line, the warning says " The static method getIncidentId(Persistent Session) from the type SessionInfo should be accessed in a static way.
this is the line where the warning shows up...
incidentId = sessionInfo.getIncidentId(session);
what should I do to resolve this?
thanks,
Ngai
===========================================================
protected ControllerResponse runActivateCDKState(ControllerRequest request,
ControllerResponse response)
throws ControllerException {
if (log.isDebugEnabled()) {
log.debug("BEGIN: runActivateCDKState");
}
if (!checkSession(request, response)) {
return (response);
}
/*
* get data from the user session
*/
String incidentId = null;
SessionInfo sessionInfo = new SessionInfo();
PersistentSession session = request.getSession();
try {
incidentId = sessionInfo.getIncidentId(session);
} catch (ServletException ex) {
log.error("Exception: error accessing user's session information.");
log.error("Exception: " + ex.getMessage());
}
String team = null;
try {
NotificationDBO dboNotif = new NotificationDBO();
dboNotif.setDBName(request.getDBName());
boolean bActive = dboNotif.doActivate(false, team, incidentId);
if (bActive) {
if (log.isDebugEnabled()) {
log.debug("END: runActivateCDKState - Successful!");
}
} else {
ErrorCollection ec = new ErrorCollection();
ec.addError("Error activating CDK team.");
response.saveErrors(ec);
log.error("Error activating CDK team.");
if (log.isDebugEnabled()) {
log.debug("END:.....................runActivateCDKState - Unsuccessful!");
}
}
} catch (DBException dbex) {
log.error("Exception: runActivateCDKState(): " + dbex.getMessage());
}
//end catch
runMemberStatsState(request, response);
return (response);
}