-1

I'm trying to write a Framework like Spring MVC. I'm looking for a way to modify the code of the doPost/doGet method of a servlet 3.0 deployed on tomcat using javassist or reflection or whatever so the doPost can call a service method dynamically defined .

doPost(...){

    ServiceClassName.methodeName(); // dynamic line of code 

}

Thanks

stdunbar
  • 16,263
  • 11
  • 31
  • 53
tutanck
  • 11
  • 4

2 Answers2

1

It is possible using javassist. Refer this to write your Transformer class.

s s
  • 286
  • 2
  • 14
0

Although I have never tried it before, have a look at http://www.bytebuddy.net for a bytecode creation/manipulation library.