コード例 #1
0
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final java.lang.String _jspx_method = request.getMethod();
    if (!"GET".equals(_jspx_method)
        && !"POST".equals(_jspx_method)
        && !"HEAD".equals(_jspx_method)
        && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      response.sendError(
          HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
      return;
    }

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("  \n");
      out.write(" ");
      request.setCharacterEncoding("utf-8");
      out.write('\n');
      out.write(' ');
      movie.admin.filmBean gb = null;
      gb =
          (movie.admin.filmBean)
              _jspx_page_context.getAttribute("gb", javax.servlet.jsp.PageContext.PAGE_SCOPE);
      if (gb == null) {
        gb = new movie.admin.filmBean();
        _jspx_page_context.setAttribute("gb", gb, javax.servlet.jsp.PageContext.PAGE_SCOPE);
      }
      out.write('\n');
      out.write(' ');
      movie.admin.film _film = null;
      _film =
          (movie.admin.film)
              _jspx_page_context.getAttribute("_film", javax.servlet.jsp.PageContext.PAGE_SCOPE);
      if (_film == null) {
        _film = new movie.admin.film();
        _jspx_page_context.setAttribute("_film", _film, javax.servlet.jsp.PageContext.PAGE_SCOPE);
      }
      out.write('\n');
      out.write(' ');
      org.apache.jasper.runtime.JspRuntimeLibrary.introspect(
          _jspx_page_context.findAttribute("_film"), request);
      out.write("\n");
      out.write(" \n");
      out.write("\n");
      out.write(" ");

      String action = request.getParameter("action");

      if (action.equals("list")) {
        ArrayList<film> films = gb.getDBlist();
        request.setAttribute("datas", films);
        pageContext.forward("admin_mode.jsp");
      }
      if (action.equals("back")) {
        ArrayList<film> films = gb.getDBlist();
        request.setAttribute("datas", films);
        pageContext.forward("admin_mode.jsp");
      } else if (action.equals("insert")) {
        if (gb.insertDB(_film)) {
          response.sendRedirect("film_control.jsp?action=list");
        } else throw new Exception("DB 입력 오류");
      } else if (action.equals("delete")) {

        if (gb.deleteDB(_film.getId_film())) {
          response.sendRedirect("film_control.jsp?action=list");
        } else throw new Exception("DB 삭제 오류");
      }
      // else if(action.equals("update")){
      // }
      else {
      }

      out.write("\n");
      out.write("    \n");
      out.write(
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("<title>Insert title here</title>\n");
      out.write("</head>\n");
      out.write("<body>\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</html>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html; charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write('\r');
      out.write('\n');
      out.write(' ');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write('\r');
      out.write('\n');
      if (_jspx_meth_c_005fset_005f0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write(" \r\n");
      out.write("  \r\n");

      Object obj = session.getAttribute("session");
      // attribut session ok, test si utilisateur courant la possède
      if (obj != null) {
        ForumBeanManager fbm = new ForumBeanManager();
        if (fbm.estMembre(obj.toString()) == false) {
          session.invalidate();

          out.write("\r\n");
          out.write("\t\t");
          if (true) {
            _jspx_page_context.forward("./login.jsp");
            return;
          }
          out.write('\r');
          out.write('\n');

        }
        // On récupère l'utilisateur courant et on l'attribut  à la session
        else {
          Utilisateur uCourant = fbm.getUtilisateur(obj.toString());
          session.setAttribute("user", uCourant);
        }

        out.write("\r\n");
        out.write("\t\r\n");

      }
      // Pas d'attribut session, redirection vers la page de login
      else {
        session.setAttribute(
            "Erreur", "L'accès au forum nécessite une authentification préalable !");

        out.write('\r');
        out.write('\n');
        out.write('	');
        if (true) {
          _jspx_page_context.forward("./login.jsp");
          return;
        }
        out.write('\r');
        out.write('\n');
      }

      out.write('\r');
      out.write('\n');
      out.write(' ');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write('\r');
      out.write('\n');
      if (_jspx_meth_c_005fset_005f1(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      ForumBeanManager fbm = new ForumBeanManager();
      Utilisateur uCourant = (Utilisateur) session.getAttribute("user");
      if (fbm.isAdmin(uCourant) == true) {

        out.write('\r');
        out.write('\n');
        //  stripes:layout-render
        net.sourceforge.stripes.tag.layout.LayoutRenderTag
            _jspx_th_stripes_005flayout_002drender_005f0 =
                (net.sourceforge.stripes.tag.layout.LayoutRenderTag)
                    _005fjspx_005ftagPool_005fstripes_005flayout_002drender_0026_005ftitle_005fname
                        .get(net.sourceforge.stripes.tag.layout.LayoutRenderTag.class);
        _jspx_th_stripes_005flayout_002drender_005f0.setPageContext(_jspx_page_context);
        _jspx_th_stripes_005flayout_002drender_005f0.setParent(null);
        // /admin.jsp(15,0) name = name type = null reqTime = true required = true fragment = false
        // deferredValue = false expectedTypeName = null deferredMethod = false methodSignature =
        // null
        _jspx_th_stripes_005flayout_002drender_005f0.setName("/style.jsp");
        // /admin.jsp(15,0) null
        _jspx_th_stripes_005flayout_002drender_005f0.setDynamicAttribute(
            null, "title", "CRUDE gestion membres");
        int _jspx_eval_stripes_005flayout_002drender_005f0 =
            _jspx_th_stripes_005flayout_002drender_005f0.doStartTag();
        if (_jspx_eval_stripes_005flayout_002drender_005f0
            != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
          if (_jspx_eval_stripes_005flayout_002drender_005f0
              != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
            out = _jspx_page_context.pushBody();
            _jspx_th_stripes_005flayout_002drender_005f0.setBodyContent(
                (javax.servlet.jsp.tagext.BodyContent) out);
            _jspx_th_stripes_005flayout_002drender_005f0.doInitBody();
          }
          do {
            out.write("\r\n");
            out.write("\r\n");
            out.write("<h3>Bienvenue sur le module de gestion des membres</h3>\r\n");
            out.write("\r\n");
            //  stripes:layout-component
            net.sourceforge.stripes.tag.layout.LayoutComponentTag
                _jspx_th_stripes_005flayout_002dcomponent_005f0 =
                    (net.sourceforge.stripes.tag.layout.LayoutComponentTag)
                        _005fjspx_005ftagPool_005fstripes_005flayout_002dcomponent_0026_005fname
                            .get(net.sourceforge.stripes.tag.layout.LayoutComponentTag.class);
            _jspx_th_stripes_005flayout_002dcomponent_005f0.setPageContext(_jspx_page_context);
            _jspx_th_stripes_005flayout_002dcomponent_005f0.setParent(
                (javax.servlet.jsp.tagext.Tag) _jspx_th_stripes_005flayout_002drender_005f0);
            // /admin.jsp(19,0) name = name type = null reqTime = true required = true fragment =
            // false deferredValue = false expectedTypeName = null deferredMethod = false
            // methodSignature = null
            _jspx_th_stripes_005flayout_002dcomponent_005f0.setName("contents");
            int _jspx_eval_stripes_005flayout_002dcomponent_005f0 =
                _jspx_th_stripes_005flayout_002dcomponent_005f0.doStartTag();
            if (_jspx_eval_stripes_005flayout_002dcomponent_005f0
                != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
              if (_jspx_eval_stripes_005flayout_002dcomponent_005f0
                  != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.pushBody();
                _jspx_th_stripes_005flayout_002dcomponent_005f0.setBodyContent(
                    (javax.servlet.jsp.tagext.BodyContent) out);
                _jspx_th_stripes_005flayout_002dcomponent_005f0.doInitBody();
              }
              do {
                out.write("\r\n");
                out.write("\r\n");
                out.write("\r\n");
                out.write("<div style=\"float:left:width:18%\"></div>\r\n");
                out.write(" <div style=\"margin-left:20%;\">\r\n");
                out.write(" <h3>Liste des utilisateurs</h3>\r\n");
                out.write("<TABLE class=\"tab\" >\r\n");
                out.write("<tr class=\"tab_titre\">\r\n");
                out.write("<td align=\"center\">id</td>\r\n");
                out.write("<td align=\"center\">role</td>\r\n");
                out.write("<td align=\"center\">pseudo</td>\r\n");
                out.write("<td align=\"center\">mail</td>\r\n");
                out.write("<td align=\"center\">modifier</td>\r\n");
                out.write("<td align=\"center\">supprimer</td>\r\n");
                out.write("</tr>\r\n");

                // On récupère l'ensemble des topics
                List<Utilisateur> users = fbm.listeruser();

                for (Utilisateur u : users) {

                  out.write('\r');
                  out.write('\n');
                  //  stripes:form
                  net.sourceforge.stripes.tag.FormTag _jspx_th_stripes_005fform_005f0 =
                      (net.sourceforge.stripes.tag.FormTag)
                          _005fjspx_005ftagPool_005fstripes_005fform_0026_005ffocus_005fbeanclass
                              .get(net.sourceforge.stripes.tag.FormTag.class);
                  _jspx_th_stripes_005fform_005f0.setPageContext(_jspx_page_context);
                  _jspx_th_stripes_005fform_005f0.setParent(
                      (javax.servlet.jsp.tagext.Tag)
                          _jspx_th_stripes_005flayout_002dcomponent_005f0);
                  // /admin.jsp(41,0) name = beanclass type = java.lang.Object reqTime = true
                  // required = false fragment = false deferredValue = false expectedTypeName = null
                  // deferredMethod = false methodSignature = null
                  _jspx_th_stripes_005fform_005f0.setBeanclass("Controllers.RedirectActionBean");
                  // /admin.jsp(41,0) name = focus type = java.lang.String reqTime = true required =
                  // false fragment = false deferredValue = false expectedTypeName = null
                  // deferredMethod = false methodSignature = null
                  _jspx_th_stripes_005fform_005f0.setFocus("");
                  int[] _jspx_push_body_count_stripes_005fform_005f0 = new int[] {0};
                  try {
                    int _jspx_eval_stripes_005fform_005f0 =
                        _jspx_th_stripes_005fform_005f0.doStartTag();
                    if (_jspx_eval_stripes_005fform_005f0
                        != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
                      if (_jspx_eval_stripes_005fform_005f0
                          != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                        out = _jspx_page_context.pushBody();
                        _jspx_push_body_count_stripes_005fform_005f0[0]++;
                        _jspx_th_stripes_005fform_005f0.setBodyContent(
                            (javax.servlet.jsp.tagext.BodyContent) out);
                        _jspx_th_stripes_005fform_005f0.doInitBody();
                      }
                      do {
                        out.write('\r');
                        out.write('\n');
                        //  stripes:hidden
                        net.sourceforge.stripes.tag.InputHiddenTag
                            _jspx_th_stripes_005fhidden_005f0 =
                                (net.sourceforge.stripes.tag.InputHiddenTag)
                                    _005fjspx_005ftagPool_005fstripes_005fhidden_0026_005fvalue_005fname_005fid_005fnobody
                                        .get(net.sourceforge.stripes.tag.InputHiddenTag.class);
                        _jspx_th_stripes_005fhidden_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_stripes_005fhidden_005f0.setParent(
                            (javax.servlet.jsp.tagext.Tag) _jspx_th_stripes_005fform_005f0);
                        // /admin.jsp(42,0) name = name type = null reqTime = true required = true
                        // fragment = false deferredValue = false expectedTypeName = null
                        // deferredMethod = false methodSignature = null
                        _jspx_th_stripes_005fhidden_005f0.setName("iduser");
                        // /admin.jsp(42,0) name = id type = null reqTime = true required = false
                        // fragment = false deferredValue = false expectedTypeName = null
                        // deferredMethod = false methodSignature = null
                        _jspx_th_stripes_005fhidden_005f0.setId("q1");
                        // /admin.jsp(42,0) name = value type = java.lang.Object reqTime = true
                        // required = false fragment = false deferredValue = false expectedTypeName
                        // = null deferredMethod = false methodSignature = null
                        _jspx_th_stripes_005fhidden_005f0.setValue(u.getIdUtilisateur());
                        int[] _jspx_push_body_count_stripes_005fhidden_005f0 = new int[] {0};
                        try {
                          int _jspx_eval_stripes_005fhidden_005f0 =
                              _jspx_th_stripes_005fhidden_005f0.doStartTag();
                          if (_jspx_th_stripes_005fhidden_005f0.doEndTag()
                              == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                            return;
                          }
                        } catch (java.lang.Throwable _jspx_exception) {
                          while (_jspx_push_body_count_stripes_005fhidden_005f0[0]-- > 0)
                            out = _jspx_page_context.popBody();
                          _jspx_th_stripes_005fhidden_005f0.doCatch(_jspx_exception);
                        } finally {
                          _jspx_th_stripes_005fhidden_005f0.doFinally();
                          _005fjspx_005ftagPool_005fstripes_005fhidden_0026_005fvalue_005fname_005fid_005fnobody
                              .reuse(_jspx_th_stripes_005fhidden_005f0);
                        }
                        out.write("\r\n");
                        out.write("\r\n");
                        out.write("\r\n");
                        out.write("<tr>\r\n");
                        out.write("<td>");
                        out.print(u.getIdUtilisateur());
                        out.write("</td>\r\n");
                        out.write("<td>");
                        out.print(u.getDroit().getDroit());
                        out.write("</td>\r\n");
                        out.write("<td>");
                        out.print(u.getPseudo());
                        out.write("</td>\r\n");
                        out.write("<td>");
                        out.print(u.getMail());
                        out.write("</td>\r\n");
                        out.write("<td>");
                        if (_jspx_meth_stripes_005fsubmit_005f0(
                            _jspx_th_stripes_005fform_005f0,
                            _jspx_page_context,
                            _jspx_push_body_count_stripes_005fform_005f0)) return;
                        out.write("</td>\r\n");
                        int i = uCourant.getIdUtilisateur();
                        int j = u.getIdUtilisateur();
                        if ((i) == (j)) {
                          out.write("\r\n");
                          out.write("<td><i>impossible</i> </td>\r\n");
                        } else {
                          out.write("\r\n");
                          out.write("<td>");
                          if (_jspx_meth_stripes_005fsubmit_005f1(
                              _jspx_th_stripes_005fform_005f0,
                              _jspx_page_context,
                              _jspx_push_body_count_stripes_005fform_005f0)) return;
                          out.write("</td>\r\n");
                        }
                        out.write("\r\n");
                        out.write("</tr>\r\n");
                        out.write("\r\n");
                        out.write("\r\n");
                        int evalDoAfterBody = _jspx_th_stripes_005fform_005f0.doAfterBody();
                        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
                          break;
                      } while (true);
                      if (_jspx_eval_stripes_005fform_005f0
                          != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                        out = _jspx_page_context.popBody();
                        _jspx_push_body_count_stripes_005fform_005f0[0]--;
                      }
                    }
                    if (_jspx_th_stripes_005fform_005f0.doEndTag()
                        == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
                      return;
                    }
                  } catch (java.lang.Throwable _jspx_exception) {
                    while (_jspx_push_body_count_stripes_005fform_005f0[0]-- > 0)
                      out = _jspx_page_context.popBody();
                    _jspx_th_stripes_005fform_005f0.doCatch(_jspx_exception);
                  } finally {
                    _jspx_th_stripes_005fform_005f0.doFinally();
                    _005fjspx_005ftagPool_005fstripes_005fform_0026_005ffocus_005fbeanclass.reuse(
                        _jspx_th_stripes_005fform_005f0);
                  }
                  out.write("\r\n");
                  out.write("\r\n");
                }
                out.write("\r\n");
                out.write("</TABLE>\r\n");
                out.write("</div>\r\n");
                out.write("\r\n");
                out.write("\t");
                int evalDoAfterBody = _jspx_th_stripes_005flayout_002dcomponent_005f0.doAfterBody();
                if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
              } while (true);
              if (_jspx_eval_stripes_005flayout_002dcomponent_005f0
                  != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                out = _jspx_page_context.popBody();
              }
            }
            if (_jspx_th_stripes_005flayout_002dcomponent_005f0.doEndTag()
                == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
              _005fjspx_005ftagPool_005fstripes_005flayout_002dcomponent_0026_005fname.reuse(
                  _jspx_th_stripes_005flayout_002dcomponent_005f0);
              return;
            }
            _005fjspx_005ftagPool_005fstripes_005flayout_002dcomponent_0026_005fname.reuse(
                _jspx_th_stripes_005flayout_002dcomponent_005f0);
            out.write('\r');
            out.write('\n');
            out.write('	');
            int evalDoAfterBody = _jspx_th_stripes_005flayout_002drender_005f0.doAfterBody();
            if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
          } while (true);
          if (_jspx_eval_stripes_005flayout_002drender_005f0
              != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
            out = _jspx_page_context.popBody();
          }
        }
        if (_jspx_th_stripes_005flayout_002drender_005f0.doEndTag()
            == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
          _005fjspx_005ftagPool_005fstripes_005flayout_002drender_0026_005ftitle_005fname.reuse(
              _jspx_th_stripes_005flayout_002drender_005f0);
          return;
        }
        _005fjspx_005ftagPool_005fstripes_005flayout_002drender_0026_005ftitle_005fname.reuse(
            _jspx_th_stripes_005flayout_002drender_005f0);
        out.write('\r');
        out.write('\n');

      } else {

        out.write('\r');
        out.write('\n');
        if (true) {
          _jspx_page_context.forward("/login.jsp");
          return;
        }
        out.write('\r');
        out.write('\n');
      }

      out.write('\r');
      out.write('\n');
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }