perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.64k stars 1.56k forks source link

notFound does not work #1051

Closed ghost closed 5 years ago

ghost commented 5 years ago

Even when I register the response for 404 response codes spark responses with not found and says powered by jetty.

perwendel commented 5 years ago

This seems very strange. This functionality has been present for quite a while and there has been no report of not working. I just tried this out:

get("/hello", (q, a) -> "hello");
notFound("custom 404");

ran and access localhost:4567/notmatched and got the result custom 404.

tipsy commented 5 years ago

Not running embedded perhaps?

ghost commented 5 years ago

What do you mean? I thought 2.7.2 has embedded?

ghost commented 5 years ago

I'll try making a new project and test it