Package javax.servlet

Examples of javax.servlet.ServletException


        String path = null;
        try {
          ResourceXmlBean bean = Resources.getResourceXmlBean(servlet,id);
          path = bean.getDirectory();
        } catch( Exception e ) {
          throw new ServletException(e);
        }       
        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
       
View Full Code Here


        String path = null;
        try {
          ResourceXmlBean bean = Resources.getResourceXmlBean(servlet,id);
          path = bean.getDirectory();
        } catch( Exception e ) {
          throw new ServletException(e);
        }       
        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
       
View Full Code Here

        String path = null;
        try {
          ResourceXmlBean bean = Resources.getResourceXmlBean(servlet,id);
          path = bean.getDirectory();
        } catch( Exception e ) {
          throw new ServletException(e);
        }
       
        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
View Full Code Here

    try {
      ResourceXmlBean bean =
        Resources.getResourceXmlBean(this, resourcesId);
      path = bean.getDirectory();
    } catch (Exception e) {
      throw new ServletException(e);
    }
    String realPath = getServletContext().getRealPath("/");
    File resources = new File(realPath, ResourceServlet.relativePath);
    File tresources = new File(resources, path);
    File tfile = new File(tresources, resourceId);
View Full Code Here

        String path = null;
        try {
          ResourceXmlBean bean = Resources.getResourceXmlBean(servlet,id);
          path = bean.getDirectory();
        } catch( Exception e ) {
          throw new ServletException(e);
        }
       
        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
View Full Code Here

     
      Mapping.rollback();

    } catch (Exception e) {
      Mapping.rollback();
      throw new ServletException(e);
    }

    // Forward to the next page
    return (mapping.findForward("view"));
View Full Code Here

        request.setAttribute("groups", groups);

      } catch (Exception e) {
        Mapping.rollback();
        throw new ServletException(e);
      }

      // Forward to the view page
      return (mapping.findForward("view"));
    }

    // fill data | errors
    if (errors.size() > 0) {
      try {
        Mapping.begin();
        Vector groups = Group.listAll();
        Mapping.rollback();

        request.setAttribute("groups", groups);
        request.setAttribute(ERROR_KEY, errors);

      } catch (Exception e) {
        Mapping.rollback();
        throw new ServletException(e);
      }

      // Forward to the view page
      return (mapping.findForward("view"));
    }

    // all it's ok : update user
    try {
      Mapping.begin();
      User user = User.create(sform.getLogin());
      user.setMetaData("name", sform.getName());
      user.setMetaData("email", sform.getEmail());
      user.setPassword(sform.getPassword());
      user.resetGroups();
      if (sform.getGroups() != null) {
        for (int i = 0; i < sform.getGroups().length; i++) {
          Group group = Group.getInstance(sform.getGroups()[i]);
          user.addGroup(group);
        }
      }
      Mapping.commit();

    } catch (Exception e) {
      Mapping.rollback();
      throw new ServletException(e);
    }

    // Forward to the next page
    return (mapping.findForward("ok"));
  }
View Full Code Here

      user.remove();
      Mapping.commit();
     
    } catch (Exception e) {
      Mapping.rollback();
      throw new ServletException(e);
    }

    // Forward to the next page
    return (mapping.findForward("ok"));
  }
View Full Code Here

      Mapping.begin();
      Indexer.reIndex();
      Mapping.rollback();
    }
    catch( Exception e ) {
      throw new ServletException(e);
    }   

    // Forward to the next page
    return (mapping.findForward("ok"));
  }
View Full Code Here

        sform.setGroups(user.getGroupsIds());
        sform.setPassword(user.getPassword());       
       
      } catch (Exception e) {
        Mapping.rollback();
        throw new ServletException(e);
      }

      // Forward to the view page
      return (mapping.findForward("view"));
    }   

    // fill data | errors
    if (errors.size() > 0) {
      try {
        request.setAttribute(ERROR_KEY, errors);
               
      } catch (Exception e) {
        Mapping.rollback();
        throw new ServletException(e);
      }

      // Forward to the view page
      return (mapping.findForward("view"));
    }

    // all it's ok : update user
    try {
      Mapping.begin();
      User user = User.getInstance(id);
      user.setMetaData("name", sform.getName());
      user.setMetaData("email", sform.getEmail());
      user.setPassword(sform.getPassword());     
      Mapping.commit();
     
    } catch (Exception e) {
      Mapping.rollback();
      throw new ServletException(e);
    }

    // Forward to the next page
    return (mapping.findForward("ok"));
  }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.