• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple URL mapping for one web app

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic