How to avoid the following error? I am implementing Spring-Security on Struts2, the application runs perfectly but the following message will be shown on server log.
Since Struts 2.1.3, an addition method call is used in doFilter ()
method of FilterDispatcher to display the warning message.
showDeprecatedWarning()
prints the message on the console. It just a System.out.println().
public void doFilter(....){
showDeprecatedWarning();
........
}
private void showDeprecatedWarning() {
String msg =
"\n\n" +
"***********************************************************************\n" +
"* WARNING!!! *\n" +
"* *\n" +
"* >>> FilterDispatcher <<< is deprecated! Please use the new filters! *\n" +
"* *\n" +
"* This can be a source of unpredictable problems! *\n" +
"* *\n" +
"* Please refer to the docs for more details! *\n" +
"* http://struts.apache.org/2.x/docs/webxml.html *\n" +
"* *\n" +
"***********************************************************************\n\n";
System.out.println(msg);
}
But Struts2 recommends to use org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
instead of org.apache.struts2.dispatcher.FilterDispatcher
.
web.xml configuration
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter