Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help to identify this object

 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
}
 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any ideas guys?

Thanks!
 
Paras Jain
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic