How to redirect rest service 404 page to customized 404 page?

http://127.0.0.1:8888/rest/getstatus/system/os/version
if restPath not found will show
no rest service for [/system/os/version] found

can i redirect to my customized 404 page (my api list page) ?
i have try 「appliction.cfc function onMissingTemplate() 」 does not trigger

OS: win2019
Java Version: 11.0.7 (AdoptOpenJDK) 64bit
Tomcat Version: Apache Tomcat/9.0.35
Lucee Version: Lucee 5.3.8.170-SNAPSHOT

Hi @gaia-jyh, I"m just curious, because REST is used for populating a client with data e.g. as application/json… how would that 404 custom page be consumed by the requesting client? Sending such a custom page doesn’t make much sense in REST. I wouldn’t send any payload at all for a 404 status code. Showing the api list is something that should be done by your api documentation.

if my restPath registered 1 function parameter 「restargsource=“Path”」
example code:

remote function getUser_json(
string name=“justin” restargsource=“Path”
,string age=“18” restargsource=“url”
) httpmethod=“GET” restPath=“user/{name}” produces=“application/json” {

    return {"name":name,"age":age};

}

in the example client use two path

http://127.0.0.1:8888/rest/getstatus/about/user/jason/18

will get 404 statusCode
and response is default text not json format only show

no rest service for [/about/user/jason/18] found

i want to show

please visit the api page [https://myRestAPIPage/about/user.cfm] to learn more

the api page 「https://myRestAPIPage/about/user.cfm」show detail api

accept exmple :
http://127.0.0.1:8888/rest/getstatus/about/user/{user_name}?age={age}
user_name:string ex. justin
age:number ex. 18

full example:
http://127.0.0.1:8888/rest/getstatus/about/user/justin?age=18

This all happens in the RestServlet, so doesn’t look like you can catch it with any Application.cfc method. I see it all happens at:

One option would be to change that text and rebuilt the Lucee.jar. Maybe someone else can tell a better solution how to intercept this error. But if nothing else works, that would be the way I’d go.