Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

welcome file configuration

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got the below code in web.xml for the webapp "mapping":

Also have "page.jsp" in the context root for the webapp.
But I am not able to access "page.jsp" with "http://localhost:8080/mapping".
Any help on this?
 
Creator of Enthuware JWS+ V6
Posts: 3339
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cyril,

Did you check the structure of your war-file? Just check what is deployed.

Regards,
Frits
 
Cyril Sadasivan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the response Frits. Actually when I restarted tomcat, everything was all set!
But I have a different problem here..
This time I have got the below code in web.xml for the webapp "mapping":

and I just have "testPage.jsp" in the context root for the webapp.
was thinking that if I use the request "http://localhost:8080/mapping/test", tomcat would append "page.jsp".
The resulting request "http://localhost:8080/mapping/test/page.jsp"; is mapped to "/testPage.jsp" in the DD.
So I think I could access "testPage.jsp" that way.

But it isn't working. I get a 404 error.

Can you tell me if I am missing something? The "test" directory is non-existent. Is that what is wrong? I did restart tomcat this time
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3339
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cyril,

Can you tell me if I am missing something? The "test" directory is non-existent. Is that what is wrong?


Yes, that is why it is not working.

According to the Servlet specs:

Welcome Files
The purpose of this mechanism is to allow the deployer to specify an ordered list of partial URIs for the container to use for appending to URIs when there is a
request for a URI that corresponds to a directory entry in the WAR not mapped to a Web component. This kind of request is known as a valid partial request.


You will need the directory "test" to get it working.

If you create a "test" directory with a "page.jsp" and you use the URI: http://localhost:8080/mapping/test, the welcome-file entry will be added, giving an URI of http://localhost:8080/mapping/test/page.jsp which will map to a Web-component (Servlet "page") and direct you to the testPage.jsp.

Regards,
Frits
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic