if (!(obj instanceof ViewContext))
{
throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
}
ViewContext viewContext = (ViewContext)obj;
this.velocityContext = viewContext.getVelocityContext();
this.request = viewContext.getRequest();
this.response = viewContext.getResponse();
this.application = viewContext.getServletContext();
if(viewContext.getVelocityEngine().getProperty("eventhandler.methodexception.class") != null) {
this.methodExceptionHandlerPresent = true;
}
}