今天刚学习拦截器的时候,书上说使用内置的 timer 可以打印出执行时间:
<package name="helloworld" extends="struts-default">
<action name="HelloWorldAction" class="com.pm.ssh.HelloWorldAction">
<result name="success">/helloname.jsp</result>
<result name="error">/error.jsp</result>
<interceptor-ref name="completeStack"/>
<interceptor-ref name="timer"/>
</action>
</package>
但我使用 struts-2.5.10-min-lib.zip 的包时,运行报错:
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console
错误很明显是缺包,因为 struts-2.5.10-min-lib.zip 中只提供了 log4j-api-2.7,并没有提供 log4j-core 包。可以去 http://logging.apache.org/ 下载。