By the start from this project, Crispy was a project for the client side. After one year development exist a new standpoint. Client side without the server side is not the best idea. In the future will Crispy go to the server side.
The future goals for release greater than 1.1.0 are:
This example is showing on a XML-RPC transport provider, how can add interceptors on a XML-RPC servlet.
The idea is to create a instance of the InterceptorHandlerCreator, where all interceptors are created and to InterceptorHandler added. Before a service method is excecuted, is a new InterceptorHandler created and all added interceptors are calling.
public class XmlRpcExampleServiceEndpoint extends XmlRpcHttpServlet { private static final long serialVersionUID = 167096795226621025L; public SubXmlRpcServiceEndpoint() { super(); // add services addService(Echo.class.getName(), new EchoImpl()); // set method for creating your own InterceptorHandlerCreator setInterceptorHandlerCreator(createInterceptorHandlerCreator()); } private InterceptorHandlerCreator createInterceptorHandlerCreator() { return new InterceptorHandlerCreator() { public InterceptorHandler createNewInterceptorHandlerInstance() { InterceptorHandler lvHandler = new InterceptorHandler(); lvHandler.addInterceptor(new LogInterceptor()); lvHandler.addInterceptor(new StopWatchInterceptor()); return lvHandler; } }; } }
=> Is this a good idea and an easy way to add a interceptor/modifier?
Get your feedback to the forum on sourceforge