1
2 from paste.deploy import CONFIG
3
4 from muntjac.terminal.gwt.server.application_servlet import ApplicationServlet
5 from muntjac.terminal.gwt.server.exceptions import ServletException
6 from muntjac.util import loadClass
7
8
9 -class app(ApplicationServlet):
10 """Servlet for use with Paste Deploy."""
11
12 SERVLET_PARAMETER_APPLICATION = 'application'
13
15
16 appClassName = CONFIG.get(self.SERVLET_PARAMETER_APPLICATION)
17
18 if appClassName is None:
19 raise ServletException, ('Application not specified '
20 'in servlet parameters')
21
22 try:
23 applicationClass = loadClass(appClassName)
24 except ImportError:
25 raise ServletException, ('Failed to import module: '
26 + appClassName)
27 except AttributeError:
28 raise ServletException, ('Failed to load application class: '
29 + appClassName)
30
31 super(app, self).__init__(applicationClass)
32
33 self._applicationProperties.update(CONFIG)
34