import mir.misc.FileExtFilter;
import mir.misc.HTMLTemplateProcessor;
import mir.servlet.ServletModule;
-import mir.servlet.ServletModuleException;
+import mir.servlet.ServletModuleExc;
+import mir.servlet.ServletModuleFailure;
import freemarker.template.SimpleHash;
import freemarker.template.SimpleList;
* in the config file.
*
* @author $Author: zapata $
- * @version $Revision: 1.5 $ $Date: 2003/02/23 05:00:15 $
+ * @version $Revision: 1.6 $ $Date: 2003/03/06 05:40:40 $
*
*/
templateConfirmString =configuration.getString("ServletModule.FileEdit.ConfirmTemplate");
}
- public void list(HttpServletRequest req, HttpServletResponse res)
- throws ServletModuleException
+ public void list(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc
{
// fetch and deliver
try {
HTMLTemplateProcessor.process(res, templateListString, mergeData, res.getWriter(), getLocale(req));
}
- catch (IOException e) {throw new ServletModuleException(e.toString());}
- catch (Exception e) {throw new ServletModuleException(e.toString());}
+ catch (Throwable e) {
+ throw new ServletModuleFailure(e);
+ }
}
- public void edit(HttpServletRequest req, HttpServletResponse res)
- throws ServletModuleException
+ public void edit(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc
{
String filename = req.getParameter("filename");
- if (filename == null) throw new ServletModuleException("No filename specified");
+ if (filename == null) throw new ServletModuleExc("No filename specified");
try {
File f = new File(_dirName, filename);
deliver(req, res, withValues, null, templateObjektString);
- } catch (Exception e) {
- throw new ServletModuleException(e.toString());
+ }
+ catch (Throwable e) {
+ throw new ServletModuleFailure(e);
}
}
- public void update(HttpServletRequest req, HttpServletResponse res)
- throws ServletModuleException
+ public void update(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc
{
String filename = req.getParameter("filename");
- if (filename == null) throw new ServletModuleException("No filename specified");
+
+ if (filename == null) throw new ServletModuleExc("No filename specified");
try {
File f = new File(_dirName, filename);
out.close();
edit(req, res);
- } catch (Exception e) {
- throw new ServletModuleException(e.toString());
+ }
+ catch (Throwable e) {
+ throw new ServletModuleFailure(e);
}
}
}