I have a website with following urls:
www.example.com/dashboard
www.example.com/user
www.example.com/user/message
www.example.com/pagenotfound
Now, what I want to achieve is that whenever user type urls other that above, I want then redirected to page not foung page.
e.g. www.example.com/otherurl
www.example.com/otherurl/otherurl
so on... will redirect to www.example.com/pagenotfound
How can I achieve this in spring MVC framework?