• 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

Help with accessing a web application

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I have a question about a web application I'm developing. Where do I specify what will happen when someone goes to the follwing URL - http://m-cable.com/thecontextroot

thecontextroot is my context root. It seems that if I go to http://m-cable.com/theapplicationname/ (with the trailing slash), that it will go to the correct welcome-file, but if I omit the slash, I get a 404 error.

Any ideas?

Thanks!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some information on what container you are using and how you have set up the web app might be helpful.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you setting the welcome files?
Can you paste as how are you writing this tag in the web.xml , remember the welcome-file tag should only have filename with extension with any starting slashes.
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul,

a small correction...

welcome-file-list 's welcome-file tag should only have entries without slashes..

here is an example..


<welcome-file-list>
<welcome-file>default.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>



what happens with the above xml entry is, if a directly path accessed,
the container first looks for default.html and then index.jsp(as specified above), and will return the one that was found first...

I am also interested as how to set the container, so that when we type somedomain.com it will take to our web app directly rather than typing, somedomain.com/somewebapp

please clarify the above..as this is a crucial thing in production environments..
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh ! that was a typo , I also meant without shashle.




I am also interested as how to set the container, so that when we type somedomain.com it will take to our web app directly rather than typing, somedomain.com/somewebapp



Put the default file (as mentioned in welcome-file tag) in the context directly.You can configure your container for virtual hosts and client will send a additional Host header with the request, that would help the container to direct the request to the correct virtual host.So if you make an request to www.rahul.net , an additional request hearder will go to server as
" target="_blank">www.rahul.net[/CODE]
and the request will be enroute to virtual host www.rahul.net and the the default file would be called as according to welcome-file tag.
Check with your container documentation as how to configure a server for virtual hosts.
 
Matt Cable
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JBoss. I don't think it's an issue with the welcome-file list. If I use this URL:
http://m-cable.com/thecontextroot/

it will bring up the index.jsp found in the welcome-file list. The problem is when I use this URL:
http://m-cable.com/thecontextroot

which is the same URL minus the trailing slash.
 
reply
    Bookmark Topic Watch Topic
  • New Topic