First of all, this is my first post so hello everyone. My question is regarding url mapping... I currently have a web application called "reo" which is accessible from http://localhost:8080/reo I would like to now have sub urls...: http://localhost:8080/reo/admin and http://localhost:8080/reo/requestdisposal However, "admin" and "requestdisposals" are still part of the reo app! What I mean is that I only have ONE web.xml and ONE struts-config.xml to work with. My folder structure is the following: fsrpda (JBuilder project name) -src (src code for ALL of reo including admin and requestdisposal ) -reo ---admin (all jsp for the admin component) ---requestdisposal (all jsps for the requestdisposal component) ---WEB-INF (for the whole reo app) I am using JBuilder9 (with Tomcat 4.1) and Struts 1.0. What can I change in the struts-config.xml and web.xml so that it knows that when I type in "http://localhost:8080/reo/admin" I have to go to , for instance, splash.do but if I go to "http://localhost:8080/reo/requestdisposal" , then I need to point to welcome_rd.jsp I don't want a redirect because after the page load, I would like the URL to remain http://localhost:8080/reo/admin/splash.do and http://localhost:8080/reo/requestdisposal/welcome_rd.jsp Is this possible without creating 2 web applications, with each their servlet?
I hope my question is clear..and that it hasn't been answered 1000 times already. Thanks in advance! [ November 26, 2003: Message edited by: Stephanie DeGuire ]
you could specify welcome_rd.jsp as a welcome file in web.xml. Why do you want to execute a struts form as soon a user comes to a url? Do you want to get information about the request without input from the user? an action like this is probably better handled with a filter servlet. toby
Joined: Nov 26, 2003
OK, I can see how my question was unclear....take 2: I would like to now have sub urls...: http://localhost:8080/reo/admin and http://localhost:8080/reo/requestdisposal with only one web app (only one web.xml and one struts-config.xml) called reo What can I change in the struts-config.xml and web.xml so that it can handle these sub-domains bust still be in the same servlet? ex: I type in "http://localhost:8080/reo/admin" I have to go to , for instance, wecome_admin.jsp but if I go to "http://localhost:8080/reo/requestdisposal" , then I need to point to welcome_rd.jsp I don't want a redirect because after the page load, I would like the URL to remain http://localhost:8080/reo/admin/xxx and http://localhost:8080/reo/requestdisposal/xxx, on all subsequent pages. Is this possible without creating 2 web applications, with each their servlet?
Joined: Nov 22, 2008
Im not sure how your would do that. The only thing i can think with struts is you make forms in one domain (admin say) map to urls that match *.ad (eg removeUser.ad) and forms in the other domain map to urls that match *.rd (eg requestADispatch.rd). Would that help? tobes