没有web.xml如何配置404页面

最近使用的框架是基于servlet 3.x。没有web.xml。我想请问有大佬知道如何配置404吗

@WebServlet("/*")
写个方法跳转到404的页面

试试看可不可以