Class AjaxServerAndClientTimeFilter
- java.lang.Object
-
- org.apache.wicket.response.filter.AjaxServerAndClientTimeFilter
-
- All Implemented Interfaces:
IResponseFilter
@Deprecated public class AjaxServerAndClientTimeFilter extends Object implements IResponseFilter
Deprecated.This class has been deprecated for several reasons. The way it tries to measure server and client times is very inaccurate. Modern browsers provide much better tools to measure Javascript execution times. The measurements were written in a property that has been deprecated for years and removed in modern browsers. Finally, rendering the Javascript directly into the response makes it hard to support a strict CSP with nonces. There is no real replacement for this class. Use the tools provided by the browser. SeeWicketExampleApplication
for a simple example of passing rendering times to the browser via theServer-Timing
header.This is a filter that injects javascript code to the top head portion and after the body so that the time can me measured what the client parse time was for this page. It also reports the total server parse/response time in the client and logs the server response time and response size it took for a specific response in the server log. You can specify what the status text should be like this: ServerAndClientTimeFilter.statustext=My Application, Server parsetime: ${servertime}, Client parsetime: ${clienttime} likewise for ajax request use ajax.ServerAndClientTimeFilter.statustextUsage: in YourApplication.java:
@Override public init() { super.init(); getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter()); }
- Author:
- jcompagner
-
-
Constructor Summary
Constructors Constructor Description AjaxServerAndClientTimeFilter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AppendingStringBuffer
filter(AppendingStringBuffer responseBuffer)
Deprecated.Filters the response buffer and returns the filtered response that can be used in the next filter or returned to the real output itself.
-
-
-
Constructor Detail
-
AjaxServerAndClientTimeFilter
public AjaxServerAndClientTimeFilter()
Deprecated.
-
-
Method Detail
-
filter
public AppendingStringBuffer filter(AppendingStringBuffer responseBuffer)
Deprecated.Description copied from interface:IResponseFilter
Filters the response buffer and returns the filtered response that can be used in the next filter or returned to the real output itself. A filter may alter the response buffer and return the response buffer itself.- Specified by:
filter
in interfaceIResponseFilter
- Parameters:
responseBuffer
- The response buffer to be filtered- Returns:
- The changed buffer or the response buffer itself (changed or not)
- See Also:
IResponseFilter.filter(org.apache.wicket.util.string.AppendingStringBuffer)
-
-