相关疑难解决方法(0)

Java - 动态地将URL模式添加到Servlet

是否可以在运行时动态地向Servlet添加URL模式?例如,当Servlet启动时,扫描文件夹中的注释,然后将这些url模式注入到servlet中?

  • 提供更清晰 -

在Servlet的init文件中,我想这样做(伪代码)

// scan all the files in the package my.project.services
// find all the classes with the Annotation @Service
// read those annotations, find the url patterns in them, and insert them into the servlet
Run Code Online (Sandbox Code Playgroud)

java servlets servlet-3.0

2
推荐指数
1
解决办法
2375
查看次数

标签 统计

java ×1

servlet-3.0 ×1

servlets ×1