web.xml url mapping

asked 2019-07-03 19:14:35 +0800

ahmeduka gravatar image ahmeduka

hellow guys

problem description: i have file in application root:


and to go to page userrights.zhtml i have to put in url: ..:8080/app/userrights.zhtml but how to change that to url like this: ..:8080/app/userrights (without file extention)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-04 10:20:58 +0800

cor3000 gravatar image cor3000
5262 2 7
ZK Team

updated 2019-07-04 10:21:38 +0800

Not a 100% solution, but the simplest thing servlet containers offer is the <welcome-file-list>

As mentioned in our example web.xml just add index.zhtml


Instead of just the file userrights.zhtml you can then create a folder with an index.zhtml inside, e.g. /userrights/index.zhtml

then you can access this file from the URL ..:8080/app/userrights

Maybe that's already enough, and doesn't require additional configuration/code. However if you need custom forwarding rules, you can always implement a servlet filter and forward requests as needed. Or add forwarding rules to your webserver, such as nginx or apache httpd.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2019-07-03 19:14:35 +0800

Seen: 7 times

Last updated: Jul 04 '19

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More