Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以(应该)在 Java-Tomcat 配置中优先考虑过滤器的执行吗?如何以及为什么(不)?例如,如果我需要在会话处理过滤器之前执行 DB-Connection 过滤器,我会按照过滤器的执行顺序执行此操作,还是我的应用程序模型中存在问题?谢谢!
过滤器执行顺序与您在 web.xml 文件中指定的过滤器顺序相同。我认为这样做没有问题。但如果你不想这样做,你可以在一个过滤器中完成。但我更喜欢用于不同目的的单独过滤器..