Charlie, On 9/10/24 16:12, charliedidon...@gmail.com wrote: > On 10/09/2024 20:21, charliedidon...@gmail.com wrote: >> I have war file in Tomcat 10.1 with a context.xml file included in >> the META-INF folder. >> >> It's contents are >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <Context path="/codereaper"/> >> >> I am getting 404s from my app and was wondering if this is still >> supported under 10.1 as it was under 9.0 > > Support is unchanged. From the 9.0.x docs: > > The value of this field must not be set unless the Context element is defined > in server.xml or the docBase is not located under the Host's appBase. > > The above setting is not valid on any currently supported version of Tomcat > including 9.0.x. > > A check of the archives show that the same (or very similar) text exists in > the docs all the way back to 5.5. > > Mark > > Weird because it did work under 9.0 with Spring MVC 4 > > Not sure if I understand your answer......but should I NOW place this > in the server.xml? As my docBase is under the webapps folder which I > understand to be my docBase by default > > As follows............ > <?xml version="1.0" encoding="UTF-8"?> <Context path="/codereaper" > docBase="webapps"> </Context>
No, you should have: <?xml version="1.0" encoding="UTF-8"?> <Context/> If you want your application to be deployed on /codereaper then you should re-name the WAR file to codereaper.war (or WAR-like directory in webapps to "codereaper" - without quotes) in webapps/. I'm pretty sure you don't even need a META-INF/context.xml file if it's so trivial. So I would delete it, re-name your WAR file (or dir) and try that. -chris The war file is named codereaper.war. The reason I asked is because I just got flamed in Stackoverflow since I asked a question about why I was getting 404s in my Spring MVC 6 app. They said I would need to change my controller mappings to include the codereaper context root in my application. So if I understand correctly the following in a JSP will equate to /codereaper ${pageContext.request.contextPath} The next one is probably a question for the Spring list but here it is anyway In Spring mvc 4 the following would equate to URLs of /codereaper/home But in Spring 6 I am getting a 404 and the access log shows 192.168.0.28 - - [10/Sep/2024:15:13:49 -0400] "GET /codereaper/home HTTP/1.1" 404 7636 @RequestMapping("/") public class MainController { static Logger logger = LogManager.getLogger(MainController.class); @RequestMapping("/home") public ModelAndView home(Model model, HttpServletRequest request, HttpServletResponse response) { ModelAndView mav = new ModelAndView(); MainContent mainContent = new MainContent(); String username; model.addAttribute("userName", "Username"); mav.setViewName("home.jsp"); return (mav); } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org