All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zeroturnaround.javarebel.integration.spring.cbp.AbstractDetectingUrlHandlerMappingCBP Maven / Gradle / Ivy

package org.zeroturnaround.javarebel.integration.spring.cbp;

import org.zeroturnaround.bundled.javassist.CtNewMethod;

import org.zeroturnaround.bundled.javassist.CtMethod;

import org.zeroturnaround.bundled.javassist.ClassPool;
import org.zeroturnaround.bundled.javassist.CtClass;
import org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor;


public class AbstractDetectingUrlHandlerMappingCBP extends JavassistClassBytecodeProcessor {

  public void process(ClassPool cp, ClassLoader cl, CtClass ctClass) throws Exception {
    CtMethod m = CtNewMethod.make(
        " protected Object lookupHandler(String urlPath, javax.servlet.http.HttpServletRequest request)\n" + 
        "      throws Exception {\n" + 
        "    detectHandlers();\n" + 
        "    return super.lookupHandler(urlPath, request);\n" + 
        "  }",
        ctClass);
    ctClass.addMethod(m);

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy