Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Another newbie-9.x-user question


This is as easy as setting up a ROOT webapp (just a directory, not a war) and defining a 404 page within the web.xml. For example:


Inside this web.xml, you define a simple webapp that, in this case, just serves up an error page:

<?xml version="1.0" encoding="UTF-8"?>
  <display-name>Simple WebApp</display-name>

This will set up a 404 page that is served when no a request is not matched to a particular webapp/context. All requests to correctly mapped virtual hosts will be handled by their designated webapp/context.


On Wed, Feb 1, 2017 at 7:52 AM, John English <john.foreign@xxxxxxxxx> wrote:
On 01/02/2017 12:52, Simone Bordet wrote:
Do you have a webapp that answers to the virtual host (or
that has no virtual hosts and therefore answers to them all) ?

If not, because you always use specific virtual hosts for your
webapps, then you can have a super-simple webapp deployed at "/" with
no virtual hosts whose only page displays a 404 message.

If I understand correctly, you're saying that I should have my webapp at "/" for a selected set of virtual hosts, and another "404" webapp at "/" for all the others that just returns a 404 for all requests. What do I need to do to make this happen? In particular, what do I need to do to stop the "404" webapp taking precedence and responding to all the requests, including the ones sent to the valid virtual hosts?

Also, why do I get zero bytes in Jetty 9.4 rather than the old Jetty-supplied 404 page that I get with Jetty 8 (as a result of the default webapp, IIRC)?

Many thanks,
John English

jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top