Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

welcome file for virtual/logical path

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have got the following servlet and -mapping in my DD:

<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>com.example.web.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/path/to/myservlet</url-pattern>
</servlet-mapping>

/path/to/myservlet is a virtual/logical path. It's not part of the file structure of my web app.

When calling http://localhost:8080/MyWebApp/path/to
I would like the server to respond with a welcome file instead of getting back a 404 error. How would you accomplish this? Please note, that /path/to/myservlet is not a physical path of my Web-Application.






 
Creator of Enthuware JWS+ V6
Posts: 3398
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rouven,

Have you tried the following welcome-file mapping:

I think you have to create a fysical path "/path/to" and put your index.html in there in order for the server to find your welcome-file.
Regards,
Frits
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi gorsky,
<welcome-file> cannot "/" character... every entry to <welcome-file> is applied to all application, (if you have directories under / YourApplication)
/path/to/myservlet is a virtual/logical path, if you configure a

will be applied to any application and not just /path/to/

You can not call direct http://localhost:8080/MyWebApp/path/to/myservlet or you can not have more than one 'path/xxx' to myservlet map, 'path/yyy' otherservlet
graciously
Rafa
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic