Tomcat not able to get ServletContext of another webapp

后端 未结 2 1781
眼角桃花
眼角桃花 2021-01-05 19:33

I am using tomcat 6 and I have two webapps. One is webapp1 and the other one is webapp2. From a filter inside webapp2, I am trying to access the other webapp i.e webapp1. My

相关标签:
2条回答
  • 2021-01-05 19:40

    Worked in a little different way for Apache Tomcat 8.0.27. Instead of changing its server.xml, it took me to update the context.xml file of tomcat with the crossContext attribute of Context tag.

    0 讨论(0)
  • 2021-01-05 19:43

    Set crossContext = "true" in the server.xml. See the documentation for the context container.

    Set to true if you want calls within this application to ServletContext.getContext() to successfully return a request dispatcher for other web applications running on this virtual host. Set to false (the default) in security conscious environments, to make getContext() always return null.

    0 讨论(0)
提交回复
热议问题