- public void insert(HttpServletRequest req, HttpServletResponse res)
- throws ServletModuleException
- {
- try {
- HashMap withValues = getIntersectingValues(req, mainModule.getStorageObject());
- String id = mainModule.add(withValues);
- deliver(req, res, mainModule.getById(id), templateObjektString);
- }
- catch (Exception e) { throw new ServletModuleException(e.toString());}
- }
+ public void edit(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
+ {
+ String idParam = req.getParameter("id");
+
+ if (idParam == null)
+ throw new ServletModuleException("ServletModuleUser.edit: invalid call: (id) not specified");
+
+ try {
+ deliver(req, res, mainModule.getById(idParam), templateObjektString);
+ }
+ catch (ModuleException e) {
+ throw new ServletModuleException(e.toString());
+ }
+ }
+
+ public void add(HttpServletRequest req, HttpServletResponse res)
+ throws ServletModuleException
+ {
+ try {
+ SimpleHash mergeData = new SimpleHash();
+ mergeData.put("new", "1");
+ deliver(req, res, mergeData, templateObjektString);
+ }
+ catch (Exception e) { throw new ServletModuleException(e.toString());}
+ }
+
+ public void insert(HttpServletRequest req, HttpServletResponse res)
+ throws ServletModuleException
+ {
+ try {
+ HashMap withValues = getIntersectingValues(req, mainModule.getStorageObject());
+ String id = mainModule.add(withValues);
+ deliver(req, res, mainModule.getById(id), templateObjektString);
+ }
+ catch (Exception e) { throw new ServletModuleException(e.toString());}
+ }