[xmlWiki-developers] Simplified servlet URL
Brought to you by:
elhugo
From: Jim K. <ka...@ie...> - 2001-11-15 00:58:22
|
As the org.xmlwiki.* was added to the already-long URL, I decide to actually read a bit about server.xml and web.xml to simplify the mapping from URL to servlet. Under the WEB-INF directory of the servlet in question (ie. ServletSpike), create a 'web.xml' file with contents similar to the one I attached. The will map the portion of the URL after the /ServletSpike to a specific class, like org.xmlwiki.PreviewPage. In your 'server.xml' file in the Tomcat /conf directory, add the following context: <Context path="/xmlWiki" docBase="webapps/ServletSpike" crossContext="false" debug="0" reloadable="true" > </Context> This maps everything after the base address to the proper servlet directory. The net result of these two minor changes: old - http://127.0.0.1:8080/ServletSpike/servlet/org.xmlwiki.PreviewPage new - http://127.0.0.1:8080/xmlWiki Much cleaner... Enjoy, Jim |