From: deelan <de...@in...> - 2005-01-31 08:46:06
|
lloyd wrote: (...) > i have the opportunity, an unrelated question (which may stem from > my conception of contexts as isolated applications): in servlets, is it > possible (or even desirable) to have paths interpreted relative to the > context root? > > eg, using the example above, when i reference a cheetah template i have > to do something like this: > > template = Template(file="inventory/stock-levels.tmpl") > > this feels awkward to me - again, perhaps because i think that the > context is the application root, and therefore the application shouldn't > have to know the name of the directory that its files are in. for this specific task you may want to experiment with Application.serverSidePath (resolves relative paths from the *application* root), Page.serverSidePath (resolves relative paths from the current servlet), Request.serverSideContextPath and Request.contextName. |