| Author |
Help to identify this object
|
Atul Sawant
Ranch Hand
Joined: Jul 06, 2006
Posts: 304
|
|
Hello Struts gurus.... this is a snippet from a code of a class extending Action class..... Please let me know which object does the variable 'servlet' refer to?
// Log this event, if appropriate if (servlet.getDebug() >= Constants.DEBUG) { StringBuffer message = new StringBuffer("LogonAction: User '"); message.append(username); message.append("' logged on in session "); message.append(session.getId()); servlet.log(message.toString); }
|
Mission SCWCD. Mission SCJP Complete: SCJP 1.4 - 91%
|
 |
Atul Sawant
Ranch Hand
Joined: Jul 06, 2006
Posts: 304
|
|
Any ideas guys? Thanks!
|
 |
Paras Jain
Ranch Hand
Joined: Feb 26, 2005
Posts: 137
|
|
servlet.getDebug() and other methods in your example definitely does not belong to HttpServlet class. You have the access to the code you can simply see the method in which this code appears. See the method arguments.
|
Paras Jain
SCJP 5.0
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
In this code, the servlet variable is referring to the Struts ActionServlet. It's clear, though, from the use of the getDebug() method that this code was written for Struts version 1.0 because in later versions this method is deprecated. Later versions use Apache Commons logging and don't use this debug flag in the ActionServlet.
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: Help to identify this object
|
|
|