今天在修改项目一个JSP文件时,突然想到Tomat是怎么实现动态实时加载JSP编译后的class类的? 查了半天资料,看了很多文章,终于明白是怎么回事了:ClassLoader,当tomcat发现jsp改变后,将用新的ClassLoader去加载新的类 具体原理我将单独总结一下,这里简单实现了动态加载类 1.定义服务类 public class Servlet { public void service(){ System.out.println("运行服务方法"); } } 2.定义…
当遇到多个Jsp include一起的时候加载时遇到如下错误: Error:SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [136] in the generated java file: **** The code of method _…
private List<IVisualControlsPlug> visualPlugs = new List<IVisualControlsPlug>(); public void Load() { DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory); foreach (FileInfo fi in di.GetFiles("VisualControls.*.dll&q…