This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes multiple URL mapping for one web app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "multiple URL mapping for one web app" Watch "multiple URL mapping for one web app" New topic
Author

multiple URL mapping for one web app

Stephanie DeGuire
Greenhorn

Joined: Nov 26, 2003
Posts: 2
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 ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
Stephanie DeGuire
Greenhorn

Joined: Nov 26, 2003
Posts: 2
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?
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple URL mapping for one web app
 
Similar Threads
Struts url problem
URL mapping
Default page for some path
Use welcome-file-list to run struts action?
Include file doubt?