Example usage for javax.servlet.http HttpServletRequest getLocalAddr

List of usage examples for javax.servlet.http HttpServletRequest getLocalAddr

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getLocalAddr.

Prototype

public String getLocalAddr();

Source Link

Document

Returns the Internet Protocol (IP) address of the interface on which the request was received.

Usage

From source file:org.codehaus.wadi.web.impl.StandardHttpProxy.java

protected void doProxy(URI uri, WebInvocation context) throws ProxyingException {
    HttpServletRequest req = context.getHreq();
    HttpServletResponse res = context.getHres();

    String requestURI = getRequestURI(req);
    String qs = req.getQueryString();
    if (qs != null) {
        requestURI = new StringBuffer(requestURI).append("?").append(qs).toString();
    }/*w  w w  . j  a va  2  s .  c  o  m*/

    URL url = null;
    try {
        url = new URL("http", uri.getHost(), uri.getPort(), requestURI);
        if (_log.isTraceEnabled())
            _log.trace("proxying to: " + url);
    } catch (MalformedURLException e) {
        if (_log.isWarnEnabled())
            _log.warn("bad proxy url: " + url, e);
        throw new IrrecoverableException("bad proxy url", e);
    }

    long startTime = System.currentTimeMillis();

    HttpURLConnection huc = null;
    String m = req.getMethod();
    try {
        huc = (HttpURLConnection) url.openConnection(); // IOException
        huc.setRequestMethod(m); // ProtocolException
    } catch (ProtocolException e) {
        if (_log.isWarnEnabled())
            _log.warn("unsupported http method: " + m, e);
        throw new IrrecoverableException("unsupported HTTP method: " + m, e);
    } catch (IOException e) {
        if (_log.isWarnEnabled())
            _log.warn("proxy IO problem", e);
        throw new RecoverableException("could not open proxy connection", e);
    }

    huc.setAllowUserInteraction(false);
    huc.setInstanceFollowRedirects(false);

    // check connection header
    // TODO - this might need some more time: see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
    String connectionHdr = req.getHeader("Connection"); // TODO - what if there are multiple values ?
    if (connectionHdr != null) {
        connectionHdr = connectionHdr.toLowerCase();
        if (connectionHdr.equals("keep-alive") || connectionHdr.equals("close"))
            connectionHdr = null; // TODO  ??
    }

    // copy headers - inefficient, but we are constrained by servlet API
    {
        for (Enumeration e = req.getHeaderNames(); e.hasMoreElements();) {
            String hdr = (String) e.nextElement();
            String lhdr = hdr.toLowerCase();

            if (_DontProxyHeaders.contains(lhdr))
                continue;
            if (connectionHdr != null && connectionHdr.indexOf(lhdr) >= 0) // what is going on here ?
                continue;
            // HTTP/1.1 proxies MUST parse the Connection header field before a message is forwarded and, for each connection-token in this field, remove any header field(s) from the message with the same name as the connection-token. Connection options are signaled by the presence of a connection-token in the Connection header field, not by any corresponding additional header field(s), since the additional header field may not be sent if there are no parameters associated with that connection option
            if (_WADI_IsSecure.equals(hdr)) // don't worry about case - we should be the only one messing with this header...
                continue; // strip this out - we may be being spoofed

            for (Enumeration f = req.getHeaders(hdr); f.hasMoreElements();) {
                String val = (String) f.nextElement();
                if (val != null) {
                    huc.addRequestProperty(hdr, val);
                }
            }
        }
    }

    // content ?
    boolean hasContent = false;
    {
        int contentLength = 0;
        String tmp = huc.getRequestProperty("Content-Length");
        if (tmp != null) {
            try {
                contentLength = Integer.parseInt(tmp);
            } catch (NumberFormatException ignore) {
                // ignore
            }
        }

        if (contentLength > 0)
            hasContent = true;
        else
            hasContent = (huc.getRequestProperty("Content-Type") != null);
    }

    // proxy
    {
        huc.addRequestProperty("Via", "1.1 " + req.getLocalName() + ":" + req.getLocalPort() + " \"WADI\""); // TODO - should we be giving out personal details ?
        huc.addRequestProperty("X-Forwarded-For", req.getRemoteAddr()); // adds last link in request chain...
        // String tmp=uc.getRequestProperty("Max-Forwards"); // TODO - do we really need to bother with this ?
    }

    // cache-control
    {
        String cacheControl = huc.getRequestProperty("Cache-Control");
        if (cacheControl != null
                && (cacheControl.indexOf("no-cache") >= 0 || cacheControl.indexOf("no-store") >= 0))
            huc.setUseCaches(false);
    }

    // confidentiality
    {
        if (req.isSecure()) {
            huc.addRequestProperty(_WADI_IsSecure, req.getLocalAddr().toString());
        }

        // at the other end, if this header is present we must :

        // wrap the request so that req.isSecure()=true, before processing...
        // mask the header - so it is never seen by the app.

        // the code for the other end should live in this class.

        // this code should also confirm that it not being spoofed by confirming that req.getRemoteAddress() is a cluster member...
    }
    // customize Connection
    huc.setDoInput(true);

    // client->server
    int client2ServerTotal = 0;
    {
        if (hasContent) {
            huc.setDoOutput(true);

            OutputStream toServer = null;
            try {
                InputStream fromClient = req.getInputStream(); // IOException
                toServer = huc.getOutputStream(); // IOException
                client2ServerTotal = copy(fromClient, toServer, 8192);
            } catch (IOException e) {
                new IrrecoverableException("problem proxying client request to server", e);
            } finally {
                if (toServer != null) {
                    try {
                        toServer.close(); // IOException
                    } catch (IOException e) {
                        _log.warn("problem closing server request stream", e);
                    }
                }
            }
        }
    }

    // Connect
    try {
        huc.connect(); // IOException
    } catch (IOException e) {
        if (_log.isWarnEnabled())
            _log.warn("proxy connection problem: " + url, e);
        throw new RecoverableException("could not connect to proxy target", e);
    }

    InputStream fromServer = null;

    // handler status codes etc.
    int code = 0;
    if (huc == null) {
        try {
            fromServer = huc.getInputStream(); // IOException
        } catch (IOException e) {
            if (_log.isWarnEnabled())
                _log.warn("proxying problem", e);
            throw new IrrecoverableException("problem acquiring client output", e);
        }
    } else {
        code = 502;
        //         String message="Bad Gateway: could not read server response code or message";
        try {
            code = huc.getResponseCode(); // IOException
            //            message=huc.getResponseMessage(); // IOException
        } catch (IOException e) {
            if (_log.isWarnEnabled())
                _log.warn("proxying problem", e);
            throw new IrrecoverableException("problem acquiring http server response code/message", e);
        } finally {
            //            res.setStatus(code, message); - deprecated
            res.setStatus(code);
        }

        if (code < 400) {
            // 1XX:continue, 2XX:successful, 3XX:multiple-choices...
            try {
                fromServer = huc.getInputStream(); // IOException
            } catch (IOException e) {
                if (_log.isWarnEnabled())
                    _log.warn("proxying problem", e);
                throw new IrrecoverableException("problem acquiring http client output", e);
            }
        } else {
            // 4XX:client, 5XX:server error...
            fromServer = huc.getErrorStream(); // why does this not throw IOException ?
            // TODO - do we need to use sendError()?
        }
    }

    // clear response defaults.
    res.setHeader("Date", null);
    res.setHeader("Server", null);

    // set response headers
    if (false) {
        int h = 0;
        String hdr = huc.getHeaderFieldKey(h);
        String val = huc.getHeaderField(h);
        while (hdr != null || val != null) {
            String lhdr = (hdr != null) ? hdr.toLowerCase() : null;
            if (hdr != null && val != null && !_DontProxyHeaders.contains(lhdr))
                res.addHeader(hdr, val);

            // if (_log.isDebugEnabled()) _log.debug("res " + hdr + ": " + val);

            h++;
            hdr = huc.getHeaderFieldKey(h);
            val = huc.getHeaderField(h);
        }
    } else {
        // TODO - is it a bug in Jetty that I have to start my loop at 1 ? or that key[0]==null ?
        // Try this inside Tomcat...
        String key;
        for (int i = 1; (key = huc.getHeaderFieldKey(i)) != null; i++) {
            key = key.toLowerCase();
            String val = huc.getHeaderField(i);
            if (val != null && !_DontProxyHeaders.contains(key)) {
                res.addHeader(key, val);
            }
        }
    }

    // do we need another Via header in the response...

    // server->client
    int server2ClientTotal = 0;
    {
        if (fromServer != null) {
            try {
                OutputStream toClient = res.getOutputStream();// IOException
                server2ClientTotal += copy(fromServer, toClient, 8192);// IOException
            } catch (IOException e) {
                if (_log.isWarnEnabled())
                    _log.warn("proxying problem", e);
                throw new IrrecoverableException("problem proxying server response back to client", e);
            } finally {
                try {
                    fromServer.close();
                } catch (IOException e) {
                    // well - we did our best...
                    _log.warn("problem closing server response stream", e);
                }
            }
        }
    }

    huc.disconnect();

    long endTime = System.currentTimeMillis();
    long elapsed = endTime - startTime;
    if (_log.isDebugEnabled())
        _log.debug("in:" + client2ServerTotal + ", out:" + server2ClientTotal + ", status:" + code + ", time:"
                + elapsed + ", url:" + url);
}

From source file:org.openmrs.module.personalhr.web.servlet.LoginServlet.java

/**
 * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from w  w  w.  ja  v  a2  s. co m
@Override
protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
        throws ServletException, IOException {
    final HttpSession httpSession = request.getSession();

    final String ipAddress = request.getRemoteAddr();
    Integer loginAttempts = this.loginAttemptsByIP.get(ipAddress);
    if (loginAttempts == null) {
        loginAttempts = 1;
    }

    loginAttempts++;

    boolean lockedOut = false;
    // look up the allowed # of attempts per IP
    Integer allowedLockoutAttempts = 100;

    final String allowedLockoutAttemptsGP = Context.getAdministrationService()
            .getGlobalProperty(GP_ALLOWED_LOGIN_ATTEMPTS_PER_IP, "100");
    try {
        allowedLockoutAttempts = Integer.valueOf(allowedLockoutAttemptsGP.trim());
    } catch (final NumberFormatException nfe) {
        log.error("Unable to format '" + allowedLockoutAttemptsGP + "' from global property "
                + GP_ALLOWED_LOGIN_ATTEMPTS_PER_IP + " as an integer");
    }

    // allowing for configurable login attempts here in case network setups are such that all users have the same IP address.
    if ((allowedLockoutAttempts > 0) && (loginAttempts > allowedLockoutAttempts)) {
        lockedOut = true;

        final Date lockedOutTime = this.lockoutDateByIP.get(ipAddress);
        if ((lockedOutTime != null) && (new Date().getTime() - lockedOutTime.getTime() > 300000)) {
            lockedOut = false;
            loginAttempts = 0;
            this.lockoutDateByIP.put(ipAddress, null);
        } else {
            // they haven't been locked out before, or they're trying again
            // within the time limit.  Set the locked-out date to right now
            this.lockoutDateByIP.put(ipAddress, new Date());
        }

    }

    // get the place to redirect to either now, or after they eventually
    // authenticate correctly
    String redirect = determineRedirect(request);

    if (lockedOut) {
        httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "auth.login.tooManyAttempts");
    } else {
        try {

            final String username = request.getParameter("uname");
            final String password = request.getParameter("pw");
            final String sharingToken = request.getParameter("sharingToken");

            // only try to authenticate if they actually typed in a username
            if ((username == null) || (username.length() == 0)) {
                throw new ContextAuthenticationException("Unable to authenticate with an empty username");
            }

            Context.authenticate(username, password);

            if (Context.isAuthenticated()) {
                httpSession.setAttribute("loginAttempts", 0);
                final User user = Context.getAuthenticatedUser();

                log.debug("Logged in: username=" + username + ", sharingToken=" + sharingToken);
                //update sharing token table
                if (!PersonalhrUtil.isNullOrEmpty(sharingToken)) {
                    Context.getService(PhrSharingTokenService.class).updateSharingToken(user, user.getPerson(),
                            sharingToken);
                }

                String localeString = null;
                Locale locale = null;
                // load the user's default locale if possible
                if (user.getUserProperties() != null) {
                    if (user.getUserProperties().containsKey(OpenmrsConstants.USER_PROPERTY_DEFAULT_LOCALE)) {
                        localeString = user.getUserProperty(OpenmrsConstants.USER_PROPERTY_DEFAULT_LOCALE);
                    }
                }

                if (localeString == null) {
                    localeString = "en_US";
                }
                if (localeString.length() == 5) {
                    //user's locale is language_COUNTRY (i.e. en_US)
                    final String lang = localeString.substring(0, 2);
                    final String country = localeString.substring(3, 5);
                    locale = new Locale(lang, country);
                } else {
                    // user's locale is only the language (language plus greater than 2 char country code
                    locale = new Locale(localeString);
                }

                final OpenmrsCookieLocaleResolver oclr = new OpenmrsCookieLocaleResolver();
                oclr.setLocale(request, response, locale);
                if (new UserProperties(user.getUserProperties()).isSupposedToChangePassword()) {
                    httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "User.password.change");
                    redirect = request.getContextPath() + "/changePassword.form";
                }

                // In case the user has no preferences, make sure that the context has some locale set
                if (Context.getLocale() == null) {
                    Context.setLocale(LocaleUtility.getDefaultLocale());
                }

                if (log.isDebugEnabled()) {
                    log.debug("Redirecting after login to: " + redirect);
                    log.debug("Locale address: " + request.getLocalAddr());
                }

                if ("/openmrs".equals(redirect)) {
                    final String phrRole = PersonalhrUtil.getService().getPhrRole(user);
                    final Integer personId = user.getPerson().getPersonId(); //same as patient id
                    if (PhrBasicRole.PHR_PATIENT.getValue().equals(phrRole)) {
                        if (personId != null) {
                            redirect = request.getContextPath() + "/phr/patientDashboard.form?patientId="
                                    + personId;
                            //PersonalhrUtil.addTemporayPrivileges();
                        } else {
                            log.error("Error: PHR Patient's person id is null!");
                        }
                    } else if (PhrBasicRole.PHR_RESTRICTED_USER.getValue().equals(phrRole)) {
                        if (personId != null) {
                            redirect = request.getContextPath() + "/phr/restrictedUserDashboard.form?personId="
                                    + personId;
                            //PersonalhrUtil.addTemporayPrivileges();
                        } else {
                            log.error("Error: PHR Restricted user's person id is null!");
                        }
                    } else if (PhrBasicRole.PHR_ADMINISTRATOR.getValue().equals(phrRole)) {
                        redirect = request.getContextPath() + "/phr/findPatient.htm";
                        //PersonalhrUtil.addTemporayPrivileges();
                    }
                }
                log.debug("PHR LoginServlet redirect to " + redirect);
                PersonalhrUtil.getService().logEvent(PhrLogEvent.USER_LOGIN, new Date(), user,
                        httpSession.getId(), null,
                        "redirect=" + redirect + "; client_ip=" + request.getLocalAddr());
                response.sendRedirect(redirect);

                httpSession.setAttribute(WebConstants.OPENMRS_CLIENT_IP_HTTPSESSION_ATTR,
                        request.getLocalAddr());
                httpSession.removeAttribute(WebConstants.OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR);

                // unset login attempts by this user because they were
                // able to successfully log in

                this.loginAttemptsByIP.remove(ipAddress);

                return;
            }
        } catch (final ContextAuthenticationException e) {
            // set the error message for the user telling them
            // to try again
            httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "auth.password.invalid");
        }

    }

    // send the user back the login page because they either
    // had a bad password or are locked out
    this.loginAttemptsByIP.put(ipAddress, loginAttempts);
    httpSession.setAttribute(WebConstants.OPENMRS_LOGIN_REDIRECT_HTTPSESSION_ATTR, redirect);
    response.sendRedirect(request.getContextPath() + "/phr/login.htm");
}

From source file:net.lightbody.bmp.proxy.jetty.servlet.Dump.java

public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    request.setAttribute("Dump", this);
    request.setCharacterEncoding("ISO_8859_1");
    getServletContext().setAttribute("Dump", this);

    String info = request.getPathInfo();
    if (info != null && info.endsWith("Exception")) {
        try {//from   w w  w.  j a v a2  s  .c  o m
            throw (Throwable) (Loader.loadClass(this.getClass(), info.substring(1)).newInstance());
        } catch (Throwable th) {
            throw new ServletException(th);
        }
    }

    String redirect = request.getParameter("redirect");
    if (redirect != null && redirect.length() > 0) {
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        response.sendRedirect(redirect);
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        return;
    }

    String error = request.getParameter("error");
    if (error != null && error.length() > 0) {
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        response.sendError(Integer.parseInt(error));
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        return;
    }

    String length = request.getParameter("length");
    if (length != null && length.length() > 0) {
        response.setContentLength(Integer.parseInt(length));
    }

    String buffer = request.getParameter("buffer");
    if (buffer != null && buffer.length() > 0)
        response.setBufferSize(Integer.parseInt(buffer));

    request.setCharacterEncoding("UTF-8");
    response.setContentType("text/html");

    if (info != null && info.indexOf("Locale/") >= 0) {
        try {
            String locale_name = info.substring(info.indexOf("Locale/") + 7);
            Field f = java.util.Locale.class.getField(locale_name);
            response.setLocale((Locale) f.get(null));
        } catch (Exception e) {
            LogSupport.ignore(log, e);
            response.setLocale(Locale.getDefault());
        }
    }

    String cn = request.getParameter("cookie");
    String cv = request.getParameter("value");
    String v = request.getParameter("version");
    if (cn != null && cv != null) {
        Cookie cookie = new Cookie(cn, cv);
        cookie.setComment("Cookie from dump servlet");
        if (v != null) {
            cookie.setMaxAge(300);
            cookie.setPath("/");
            cookie.setVersion(Integer.parseInt(v));
        }
        response.addCookie(cookie);
    }

    String pi = request.getPathInfo();
    if (pi != null && pi.startsWith("/ex")) {
        OutputStream out = response.getOutputStream();
        out.write("</H1>This text should be reset</H1>".getBytes());
        if ("/ex0".equals(pi))
            throw new ServletException("test ex0", new Throwable());
        if ("/ex1".equals(pi))
            throw new IOException("test ex1");
        if ("/ex2".equals(pi))
            throw new UnavailableException("test ex2");
        if ("/ex3".equals(pi))
            throw new HttpException(501);
    }

    PrintWriter pout = response.getWriter();
    Page page = null;

    try {
        page = new Page();
        page.title("Dump Servlet");

        page.add(new Heading(1, "Dump Servlet"));
        Table table = new Table(0).cellPadding(0).cellSpacing(0);
        page.add(table);
        table.newRow();
        table.addHeading("getMethod:&nbsp;").cell().right();
        table.addCell("" + request.getMethod());
        table.newRow();
        table.addHeading("getContentLength:&nbsp;").cell().right();
        table.addCell(Integer.toString(request.getContentLength()));
        table.newRow();
        table.addHeading("getContentType:&nbsp;").cell().right();
        table.addCell("" + request.getContentType());
        table.newRow();
        table.addHeading("getCharacterEncoding:&nbsp;").cell().right();
        table.addCell("" + request.getCharacterEncoding());
        table.newRow();
        table.addHeading("getRequestURI:&nbsp;").cell().right();
        table.addCell("" + request.getRequestURI());
        table.newRow();
        table.addHeading("getRequestURL:&nbsp;").cell().right();
        table.addCell("" + request.getRequestURL());
        table.newRow();
        table.addHeading("getContextPath:&nbsp;").cell().right();
        table.addCell("" + request.getContextPath());
        table.newRow();
        table.addHeading("getServletPath:&nbsp;").cell().right();
        table.addCell("" + request.getServletPath());
        table.newRow();
        table.addHeading("getPathInfo:&nbsp;").cell().right();
        table.addCell("" + request.getPathInfo());
        table.newRow();
        table.addHeading("getPathTranslated:&nbsp;").cell().right();
        table.addCell("" + request.getPathTranslated());
        table.newRow();
        table.addHeading("getQueryString:&nbsp;").cell().right();
        table.addCell("" + request.getQueryString());

        table.newRow();
        table.addHeading("getProtocol:&nbsp;").cell().right();
        table.addCell("" + request.getProtocol());
        table.newRow();
        table.addHeading("getScheme:&nbsp;").cell().right();
        table.addCell("" + request.getScheme());
        table.newRow();
        table.addHeading("getServerName:&nbsp;").cell().right();
        table.addCell("" + request.getServerName());
        table.newRow();
        table.addHeading("getServerPort:&nbsp;").cell().right();
        table.addCell("" + Integer.toString(request.getServerPort()));
        table.newRow();
        table.addHeading("getLocalName:&nbsp;").cell().right();
        table.addCell("" + request.getLocalName());
        table.newRow();
        table.addHeading("getLocalAddr:&nbsp;").cell().right();
        table.addCell("" + request.getLocalAddr());
        table.newRow();
        table.addHeading("getLocalPort:&nbsp;").cell().right();
        table.addCell("" + Integer.toString(request.getLocalPort()));
        table.newRow();
        table.addHeading("getRemoteUser:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteUser());
        table.newRow();
        table.addHeading("getRemoteAddr:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteAddr());
        table.newRow();
        table.addHeading("getRemoteHost:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteHost());
        table.newRow();
        table.addHeading("getRemotePort:&nbsp;").cell().right();
        table.addCell("" + request.getRemotePort());
        table.newRow();
        table.addHeading("getRequestedSessionId:&nbsp;").cell().right();
        table.addCell("" + request.getRequestedSessionId());
        table.newRow();
        table.addHeading("isSecure():&nbsp;").cell().right();
        table.addCell("" + request.isSecure());

        table.newRow();
        table.addHeading("isUserInRole(admin):&nbsp;").cell().right();
        table.addCell("" + request.isUserInRole("admin"));

        table.newRow();
        table.addHeading("getLocale:&nbsp;").cell().right();
        table.addCell("" + request.getLocale());

        Enumeration locales = request.getLocales();
        while (locales.hasMoreElements()) {
            table.newRow();
            table.addHeading("getLocales:&nbsp;").cell().right();
            table.addCell(locales.nextElement());
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Other HTTP Headers")
                .attribute("COLSPAN", "2").left();
        Enumeration h = request.getHeaderNames();
        String name;
        while (h.hasMoreElements()) {
            name = (String) h.nextElement();

            Enumeration h2 = request.getHeaders(name);
            while (h2.hasMoreElements()) {
                String hv = (String) h2.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().right();
                table.addCell(hv);
            }
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Request Parameters")
                .attribute("COLSPAN", "2").left();
        h = request.getParameterNames();
        while (h.hasMoreElements()) {
            name = (String) h.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().right();
            table.addCell(request.getParameter(name));
            String[] values = request.getParameterValues(name);
            if (values == null) {
                table.newRow();
                table.addHeading(name + " Values:&nbsp;").cell().right();
                table.addCell("NULL!!!!!!!!!");
            } else if (values.length > 1) {
                for (int i = 0; i < values.length; i++) {
                    table.newRow();
                    table.addHeading(name + "[" + i + "]:&nbsp;").cell().right();
                    table.addCell(values[i]);
                }
            }
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Cookies").attribute("COLSPAN", "2").left();
        Cookie[] cookies = request.getCookies();
        for (int i = 0; cookies != null && i < cookies.length; i++) {
            Cookie cookie = cookies[i];

            table.newRow();
            table.addHeading(cookie.getName() + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell(cookie.getValue());
        }

        /* ------------------------------------------------------------ */
        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Request Attributes")
                .attribute("COLSPAN", "2").left();
        Enumeration a = request.getAttributeNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(request.getAttribute(name)) + "</pre>");
        }

        /* ------------------------------------------------------------ */
        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Servlet InitParameters")
                .attribute("COLSPAN", "2").left();
        a = getInitParameterNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getInitParameter(name)) + "</pre>");
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Context InitParameters")
                .attribute("COLSPAN", "2").left();
        a = getServletContext().getInitParameterNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getServletContext().getInitParameter(name)) + "</pre>");
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Context Attributes")
                .attribute("COLSPAN", "2").left();
        a = getServletContext().getAttributeNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getServletContext().getAttribute(name)) + "</pre>");
        }

        if (request.getContentType() != null && request.getContentType().startsWith("multipart/form-data")
                && request.getContentLength() < 1000000) {
            MultiPartRequest multi = new MultiPartRequest(request);
            String[] parts = multi.getPartNames();

            table.newRow();
            table.newHeading().cell().nest(new Font(2, true)).add("<BR>Multi-part content")
                    .attribute("COLSPAN", "2").left();
            for (int p = 0; p < parts.length; p++) {
                name = parts[p];
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + multi.getString(parts[p]) + "</pre>");
            }
        }

        String res = request.getParameter("resource");
        if (res != null && res.length() > 0) {
            table.newRow();
            table.newHeading().cell().nest(new Font(2, true)).add("<BR>Get Resource: " + res)
                    .attribute("COLSPAN", "2").left();

            table.newRow();
            table.addHeading("this.getClass():&nbsp;").cell().right();
            table.addCell("" + this.getClass().getResource(res));

            table.newRow();
            table.addHeading("this.getClass().getClassLoader():&nbsp;").cell().right();
            table.addCell("" + this.getClass().getClassLoader().getResource(res));

            table.newRow();
            table.addHeading("Thread.currentThread().getContextClassLoader():&nbsp;").cell().right();
            table.addCell("" + Thread.currentThread().getContextClassLoader().getResource(res));

            table.newRow();
            table.addHeading("getServletContext():&nbsp;").cell().right();
            try {
                table.addCell("" + getServletContext().getResource(res));
            } catch (Exception e) {
                table.addCell("" + e);
            }
        }

        /* ------------------------------------------------------------ */
        page.add(Break.para);
        page.add(new Heading(1, "Request Wrappers"));
        ServletRequest rw = request;
        int w = 0;
        while (rw != null) {
            page.add((w++) + ": " + rw.getClass().getName() + "<br/>");
            if (rw instanceof HttpServletRequestWrapper)
                rw = ((HttpServletRequestWrapper) rw).getRequest();
            else if (rw instanceof ServletRequestWrapper)
                rw = ((ServletRequestWrapper) rw).getRequest();
            else
                rw = null;
        }

        page.add(Break.para);
        page.add(new Heading(1, "International Characters"));
        page.add("Directly encoced:  Drst<br/>");
        page.add("HTML reference: D&uuml;rst<br/>");
        page.add("Decimal (252) 8859-1: D&#252;rst<br/>");
        page.add("Hex (xFC) 8859-1: D&#xFC;rst<br/>");
        page.add(
                "Javascript unicode (00FC) : <script language='javascript'>document.write(\"D\u00FCrst\");</script><br/>");
        page.add(Break.para);
        page.add(new Heading(1, "Form to generate GET content"));
        TableForm tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("GET");
        tf.addTextField("TextField", "TextField", 20, "value");
        tf.addButton("Action", "Submit");
        page.add(tf);

        page.add(Break.para);
        page.add(new Heading(1, "Form to generate POST content"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.addTextField("TextField", "TextField", 20, "value");
        Select select = tf.addSelect("Select", "Select", true, 3);
        select.add("ValueA");
        select.add("ValueB1,ValueB2");
        select.add("ValueC");
        tf.addButton("Action", "Submit");
        page.add(tf);

        page.add(new Heading(1, "Form to upload content"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.attribute("enctype", "multipart/form-data");
        tf.addFileField("file", "file");
        tf.addButton("Upload", "Upload");
        page.add(tf);

        page.add(new Heading(1, "Form to get Resource"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.addTextField("resource", "resource", 20, "");
        tf.addButton("Action", "getResource");
        page.add(tf);

    } catch (Exception e) {
        log.warn(LogSupport.EXCEPTION, e);
    }

    page.write(pout);

    String data = request.getParameter("data");
    if (data != null && data.length() > 0) {
        int d = Integer.parseInt(data);
        while (d > 0) {
            pout.println("1234567890123456789012345678901234567890123456789\n");
            d = d - 50;

        }
    }

    pout.close();

    if (pi != null) {
        if ("/ex4".equals(pi))
            throw new ServletException("test ex4", new Throwable());
        if ("/ex5".equals(pi))
            throw new IOException("test ex5");
        if ("/ex6".equals(pi))
            throw new UnavailableException("test ex6");
        if ("/ex7".equals(pi))
            throw new HttpException(501);
    }

    request.getInputStream().close();

}

From source file:org.openqa.jetty.servlet.Dump.java

public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    request.setAttribute("Dump", this);
    request.setCharacterEncoding("ISO_8859_1");
    getServletContext().setAttribute("Dump", this);

    String info = request.getPathInfo();
    if (info != null && info.endsWith("Exception")) {
        try {//ww w.  j av a2s . c  om
            throw (Throwable) (Loader.loadClass(this.getClass(), info.substring(1)).newInstance());
        } catch (Throwable th) {
            throw new ServletException(th);
        }
    }

    String redirect = request.getParameter("redirect");
    if (redirect != null && redirect.length() > 0) {
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        response.sendRedirect(redirect);
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        return;
    }

    String error = request.getParameter("error");
    if (error != null && error.length() > 0) {
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        response.sendError(Integer.parseInt(error));
        response.getOutputStream().println("THIS SHOULD NOT BE SEEN!");
        return;
    }

    String length = request.getParameter("length");
    if (length != null && length.length() > 0) {
        response.setContentLength(Integer.parseInt(length));
    }

    String buffer = request.getParameter("buffer");
    if (buffer != null && buffer.length() > 0)
        response.setBufferSize(Integer.parseInt(buffer));

    request.setCharacterEncoding("UTF-8");
    response.setContentType("text/html");

    if (info != null && info.indexOf("Locale/") >= 0) {
        try {
            String locale_name = info.substring(info.indexOf("Locale/") + 7);
            Field f = java.util.Locale.class.getField(locale_name);
            response.setLocale((Locale) f.get(null));
        } catch (Exception e) {
            LogSupport.ignore(log, e);
            response.setLocale(Locale.getDefault());
        }
    }

    String cn = request.getParameter("cookie");
    String cv = request.getParameter("value");
    String v = request.getParameter("version");
    if (cn != null && cv != null) {
        Cookie cookie = new Cookie(cn, cv);
        cookie.setComment("Cookie from dump servlet");
        if (v != null) {
            cookie.setMaxAge(300);
            cookie.setPath("/");
            cookie.setVersion(Integer.parseInt(v));
        }
        response.addCookie(cookie);
    }

    String pi = request.getPathInfo();
    if (pi != null && pi.startsWith("/ex")) {
        OutputStream out = response.getOutputStream();
        out.write("</H1>This text should be reset</H1>".getBytes());
        if ("/ex0".equals(pi))
            throw new ServletException("test ex0", new Throwable());
        if ("/ex1".equals(pi))
            throw new IOException("test ex1");
        if ("/ex2".equals(pi))
            throw new UnavailableException("test ex2");
        if ("/ex3".equals(pi))
            throw new HttpException(501);
    }

    PrintWriter pout = response.getWriter();
    Page page = null;

    try {
        page = new Page();
        page.title("Dump Servlet");

        page.add(new Heading(1, "Dump Servlet"));
        Table table = new Table(0).cellPadding(0).cellSpacing(0);
        page.add(table);
        table.newRow();
        table.addHeading("getMethod:&nbsp;").cell().right();
        table.addCell("" + request.getMethod());
        table.newRow();
        table.addHeading("getContentLength:&nbsp;").cell().right();
        table.addCell(Integer.toString(request.getContentLength()));
        table.newRow();
        table.addHeading("getContentType:&nbsp;").cell().right();
        table.addCell("" + request.getContentType());
        table.newRow();
        table.addHeading("getCharacterEncoding:&nbsp;").cell().right();
        table.addCell("" + request.getCharacterEncoding());
        table.newRow();
        table.addHeading("getRequestURI:&nbsp;").cell().right();
        table.addCell("" + request.getRequestURI());
        table.newRow();
        table.addHeading("getRequestURL:&nbsp;").cell().right();
        table.addCell("" + request.getRequestURL());
        table.newRow();
        table.addHeading("getContextPath:&nbsp;").cell().right();
        table.addCell("" + request.getContextPath());
        table.newRow();
        table.addHeading("getServletPath:&nbsp;").cell().right();
        table.addCell("" + request.getServletPath());
        table.newRow();
        table.addHeading("getPathInfo:&nbsp;").cell().right();
        table.addCell("" + request.getPathInfo());
        table.newRow();
        table.addHeading("getPathTranslated:&nbsp;").cell().right();
        table.addCell("" + request.getPathTranslated());
        table.newRow();
        table.addHeading("getQueryString:&nbsp;").cell().right();
        table.addCell("" + request.getQueryString());

        table.newRow();
        table.addHeading("getProtocol:&nbsp;").cell().right();
        table.addCell("" + request.getProtocol());
        table.newRow();
        table.addHeading("getScheme:&nbsp;").cell().right();
        table.addCell("" + request.getScheme());
        table.newRow();
        table.addHeading("getServerName:&nbsp;").cell().right();
        table.addCell("" + request.getServerName());
        table.newRow();
        table.addHeading("getServerPort:&nbsp;").cell().right();
        table.addCell("" + Integer.toString(request.getServerPort()));
        table.newRow();
        table.addHeading("getLocalName:&nbsp;").cell().right();
        table.addCell("" + request.getLocalName());
        table.newRow();
        table.addHeading("getLocalAddr:&nbsp;").cell().right();
        table.addCell("" + request.getLocalAddr());
        table.newRow();
        table.addHeading("getLocalPort:&nbsp;").cell().right();
        table.addCell("" + Integer.toString(request.getLocalPort()));
        table.newRow();
        table.addHeading("getRemoteUser:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteUser());
        table.newRow();
        table.addHeading("getRemoteAddr:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteAddr());
        table.newRow();
        table.addHeading("getRemoteHost:&nbsp;").cell().right();
        table.addCell("" + request.getRemoteHost());
        table.newRow();
        table.addHeading("getRemotePort:&nbsp;").cell().right();
        table.addCell("" + request.getRemotePort());
        table.newRow();
        table.addHeading("getRequestedSessionId:&nbsp;").cell().right();
        table.addCell("" + request.getRequestedSessionId());
        table.newRow();
        table.addHeading("isSecure():&nbsp;").cell().right();
        table.addCell("" + request.isSecure());

        table.newRow();
        table.addHeading("isUserInRole(admin):&nbsp;").cell().right();
        table.addCell("" + request.isUserInRole("admin"));

        table.newRow();
        table.addHeading("getLocale:&nbsp;").cell().right();
        table.addCell("" + request.getLocale());

        Enumeration locales = request.getLocales();
        while (locales.hasMoreElements()) {
            table.newRow();
            table.addHeading("getLocales:&nbsp;").cell().right();
            table.addCell(locales.nextElement());
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Other HTTP Headers")
                .attribute("COLSPAN", "2").left();
        Enumeration h = request.getHeaderNames();
        String name;
        while (h.hasMoreElements()) {
            name = (String) h.nextElement();

            Enumeration h2 = request.getHeaders(name);
            while (h2.hasMoreElements()) {
                String hv = (String) h2.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().right();
                table.addCell(hv);
            }
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Request Parameters")
                .attribute("COLSPAN", "2").left();
        h = request.getParameterNames();
        while (h.hasMoreElements()) {
            name = (String) h.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().right();
            table.addCell(request.getParameter(name));
            String[] values = request.getParameterValues(name);
            if (values == null) {
                table.newRow();
                table.addHeading(name + " Values:&nbsp;").cell().right();
                table.addCell("NULL!!!!!!!!!");
            } else if (values.length > 1) {
                for (int i = 0; i < values.length; i++) {
                    table.newRow();
                    table.addHeading(name + "[" + i + "]:&nbsp;").cell().right();
                    table.addCell(values[i]);
                }
            }
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Cookies").attribute("COLSPAN", "2").left();
        Cookie[] cookies = request.getCookies();
        for (int i = 0; cookies != null && i < cookies.length; i++) {
            Cookie cookie = cookies[i];

            table.newRow();
            table.addHeading(cookie.getName() + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell(cookie.getValue());
        }

        /* ------------------------------------------------------------ */
        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Request Attributes")
                .attribute("COLSPAN", "2").left();
        Enumeration a = request.getAttributeNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(request.getAttribute(name)) + "</pre>");
        }

        /* ------------------------------------------------------------ */
        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Servlet InitParameters")
                .attribute("COLSPAN", "2").left();
        a = getInitParameterNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getInitParameter(name)) + "</pre>");
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Context InitParameters")
                .attribute("COLSPAN", "2").left();
        a = getServletContext().getInitParameterNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getServletContext().getInitParameter(name)) + "</pre>");
        }

        table.newRow();
        table.newHeading().cell().nest(new Font(2, true)).add("<BR>Context Attributes")
                .attribute("COLSPAN", "2").left();
        a = getServletContext().getAttributeNames();
        while (a.hasMoreElements()) {
            name = (String) a.nextElement();
            table.newRow();
            table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
            table.addCell("<pre>" + toString(getServletContext().getAttribute(name)) + "</pre>");
        }

        if (request.getContentType() != null && request.getContentType().startsWith("multipart/form-data")
                && request.getContentLength() < 1000000) {
            MultiPartRequest multi = new MultiPartRequest(request);
            String[] parts = multi.getPartNames();

            table.newRow();
            table.newHeading().cell().nest(new Font(2, true)).add("<BR>Multi-part content")
                    .attribute("COLSPAN", "2").left();
            for (int p = 0; p < parts.length; p++) {
                name = parts[p];
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + multi.getString(parts[p]) + "</pre>");
            }
        }

        String res = request.getParameter("resource");
        if (res != null && res.length() > 0) {
            table.newRow();
            table.newHeading().cell().nest(new Font(2, true)).add("<BR>Get Resource: " + res)
                    .attribute("COLSPAN", "2").left();

            table.newRow();
            table.addHeading("this.getClass():&nbsp;").cell().right();
            table.addCell("" + this.getClass().getResource(res));

            table.newRow();
            table.addHeading("this.getClass().getClassLoader():&nbsp;").cell().right();
            table.addCell("" + this.getClass().getClassLoader().getResource(res));

            table.newRow();
            table.addHeading("Thread.currentThread().getContextClassLoader():&nbsp;").cell().right();
            table.addCell("" + Thread.currentThread().getContextClassLoader().getResource(res));

            table.newRow();
            table.addHeading("getServletContext():&nbsp;").cell().right();
            try {
                table.addCell("" + getServletContext().getResource(res));
            } catch (Exception e) {
                table.addCell("" + e);
            }
        }

        /* ------------------------------------------------------------ */
        page.add(Break.para);
        page.add(new Heading(1, "Request Wrappers"));
        ServletRequest rw = request;
        int w = 0;
        while (rw != null) {
            page.add((w++) + ": " + rw.getClass().getName() + "<br/>");
            if (rw instanceof HttpServletRequestWrapper)
                rw = ((HttpServletRequestWrapper) rw).getRequest();
            else if (rw instanceof ServletRequestWrapper)
                rw = ((ServletRequestWrapper) rw).getRequest();
            else
                rw = null;
        }

        page.add(Break.para);
        page.add(new Heading(1, "International Characters"));
        page.add("Directly encoced:  Drst<br/>");
        page.add("HTML reference: D&uuml;rst<br/>");
        page.add("Decimal (252) 8859-1: D&#252;rst<br/>");
        page.add("Hex (xFC) 8859-1: D&#xFC;rst<br/>");
        page.add(
                "Javascript unicode (00FC) : <script language='javascript'>document.write(\"D\u00FCrst\");</script><br/>");
        page.add(Break.para);
        page.add(new Heading(1, "Form to generate GET content"));
        TableForm tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("GET");
        tf.addTextField("TextField", "TextField", 20, "value");
        tf.addButton("Action", "Submit");
        page.add(tf);

        page.add(Break.para);
        page.add(new Heading(1, "Form to generate POST content"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.addTextField("TextField", "TextField", 20, "value");
        Select select = tf.addSelect("Select", "Select", true, 3);
        select.add("ValueA");
        select.add("ValueB1,ValueB2");
        select.add("ValueC");
        tf.addButton("Action", "Submit");
        page.add(tf);

        page.add(new Heading(1, "Form to upload content"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.attribute("enctype", "multipart/form-data");
        tf.addFileField("file", "file");
        tf.addButton("Upload", "Upload");
        page.add(tf);

        page.add(new Heading(1, "Form to get Resource"));
        tf = new TableForm(response.encodeURL(getURI(request)));
        tf.method("POST");
        tf.addTextField("resource", "resource", 20, "");
        tf.addButton("Action", "getResource");
        page.add(tf);

    } catch (Exception e) {
        log.warn(LogSupport.EXCEPTION, e);
    }

    page.write(pout);

    String data = request.getParameter("data");
    if (data != null && data.length() > 0) {
        int d = Integer.parseInt(data);
        while (d > 0) {
            pout.println("1234567890123456789012345678901234567890123456789\n");
            d = d - 50;

        }
    }

    pout.close();

    if (pi != null) {
        if ("/ex4".equals(pi))
            throw new ServletException("test ex4", new Throwable());
        if ("/ex5".equals(pi))
            throw new IOException("test ex5");
        if ("/ex6".equals(pi))
            throw new UnavailableException("test ex6");
        if ("/ex7".equals(pi))
            throw new HttpException(501);
    }

    request.getInputStream().close();

}

From source file:org.guanxi.idp.service.saml2.WebBrowserSSO.java

/**
 * Handles processing of an AuthnRequest message. If the request attribute:
 * wbsso-handler-error-message//from  www  .jav  a  2 s . com
 * is present then we must display the error text it contains and go no further.
 * 
 * @param request Servlet request
 * @param response Servlet response
 * @return the view to display
 * @throws Exception if an error occurs
 */
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    ModelAndView mAndV = new ModelAndView();

    idpConfig = (IdpDocument.Idp) getServletContext().getAttribute(Guanxi.CONTEXT_ATTR_IDP_CONFIG);
    loadPersona(request);
    String spEntityID = (String) request.getAttribute("entityID");

    // Display an error message if it exists and go no further
    if (request.getAttribute("wbsso-handler-error-message") != null) {
        if (request.getAttribute("wbsso-handler-error-message").equals(SAML.SAML2_STATUS_NO_PASSIVE)) {
            // Return SAML2 Response as we don't do passive
            ResponseDocument errorDoc = buidErrorResponse(idpEntityID,
                    (String) request.getAttribute("requestID"), (String) request.getAttribute("acsURL"),
                    SAML.SAML2_STATUS_NO_PASSIVE);

            xmlOptions.setSaveSuggestedPrefixes(saml2Namespaces);

            Document signedDoc = null;
            if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_POST)) {
                try {
                    // Need to use newDomNode to preserve namespace information
                    signedDoc = SecUtils.getInstance().saml2Sign(secUtilsConfig,
                            (Document) errorDoc.newDomNode(xmlOptions), errorDoc.getResponse().getID());
                } catch (GuanxiException ge) {
                    logger.error("Could not sign Response", ge);
                    mAndV.setViewName(errorView);
                    mAndV.getModel().put(errorViewDisplayVar,
                            messages.getMessage("error.could.not.sign.message", null, request.getLocale()));
                    return mAndV;
                }
            }

            // Do the binding quickstep
            String b64SAMLResponse = null;
            if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_POST)) {
                b64SAMLResponse = Utils.base64(signedDoc);
                mAndV.setViewName(httpPOSTView);
            } else if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_REDIRECT)) {
                String deflatedResponse = Utils.deflate(errorDoc.toString(),
                        Utils.RFC1951_DEFAULT_COMPRESSION_LEVEL, Utils.RFC1951_NO_WRAP);
                b64SAMLResponse = Utils.base64(deflatedResponse.getBytes());
                b64SAMLResponse = b64SAMLResponse.replaceAll(System.getProperty("line.separator"), "");
                b64SAMLResponse = URLEncoder.encode(b64SAMLResponse, "UTF-8");
                mAndV.setViewName(httpRedirectView);
            }

            // Debug syphoning?
            if (idpConfig.getDebug() != null) {
                if (idpConfig.getDebug().getSypthonAttributeAssertions() != null) {
                    if (idpConfig.getDebug().getSypthonAttributeAssertions().equals("yes")) {
                        logger.info("=======================================================");
                        logger.info("Error Response to SAML2 WBSSO request by " + spEntityID);
                        logger.info("");
                        StringWriter sw = new StringWriter();
                        errorDoc.save(sw, xmlOptions);
                        logger.info(sw.toString());
                        logger.info("");
                        logger.info("=======================================================");
                    }
                }
            }

            request.setAttribute("SAMLResponse", b64SAMLResponse);
            request.setAttribute("RelayState", request.getParameter("RelayState"));
            mAndV.getModel().put("wbsso_acs_endpoint", request.getAttribute("acsURL"));
            return mAndV;
        } else {
            logger.error("Displaying auth handler error");
            mAndV.setViewName(errorView);
            mAndV.getModel().put(errorViewDisplayVar, request.getAttribute("wbsso-handler-error-message"));
            return mAndV;
        }
    } // if (request.getAttribute("wbsso-handler-error-message") != null)

    GuanxiPrincipal gxPrincipal = (GuanxiPrincipal) request.getAttribute(Guanxi.REQUEST_ATTR_IDP_PRINCIPAL);
    if (request.getAttribute("NameIDFormat") != null) {
        // Use the NameID format supplied in the request...
        gxPrincipal.setNameIDFormat((String) request.getAttribute("NameIDFormat"));
    } else {
        // ...or the default if none is specified
        gxPrincipal.setNameIDFormat(nameQualifier);
    }

    // We need this for reference in the Response
    String requestID = (String) request.getAttribute("requestID");

    // Response
    ResponseDocument responseDoc = ResponseDocument.Factory.newInstance();
    ResponseType wbssoResponse = responseDoc.addNewResponse();
    wbssoResponse.setID(generateStringID());
    wbssoResponse.setVersion("2.0");
    wbssoResponse.setDestination((String) request.getAttribute("acsURL"));
    wbssoResponse.setIssueInstant(Calendar.getInstance());
    wbssoResponse.setInResponseTo(requestID);
    Utils.zuluXmlObject(wbssoResponse, 0);

    // Response/Issuer
    NameIDType issuer = wbssoResponse.addNewIssuer();
    issuer.setFormat(SAML.URN_SAML2_NAMEID_FORMAT_ENTITY);
    issuer.setStringValue(idpEntityID);

    // Response/Status
    StatusDocument statusDoc = StatusDocument.Factory.newInstance();
    StatusType status = statusDoc.addNewStatus();
    StatusCodeType topLevelStatusCode = status.addNewStatusCode();
    topLevelStatusCode.setValue(SAML.SAML2_STATUS_SUCCESS);
    wbssoResponse.setStatus(status);

    // Response/Assertion
    AssertionDocument assertionDoc = AssertionDocument.Factory.newInstance();
    AssertionType assertion = assertionDoc.addNewAssertion();
    assertion.setID(generateStringID());
    assertion.setIssueInstant(Calendar.getInstance());
    assertion.setIssuer(issuer);
    assertion.setVersion("2.0");
    Utils.zuluXmlObject(assertion, 0);

    // Response/Assertion/Subject
    SubjectType subject = assertion.addNewSubject();
    SubjectConfirmationType subjectConfirmation = subject.addNewSubjectConfirmation();
    subjectConfirmation.setMethod(SAML.URN_SAML2_CONFIRMATION_METHOD_BEARER);
    SubjectConfirmationDataType subjectConfirmationData = subjectConfirmation.addNewSubjectConfirmationData();
    subjectConfirmationData.setAddress(request.getLocalAddr());
    subjectConfirmationData.setInResponseTo(requestID);
    subjectConfirmationData.setNotOnOrAfter(Calendar.getInstance());
    subjectConfirmationData.setRecipient((String) request.getAttribute("acsURL"));
    Utils.zuluXmlObject(subjectConfirmationData, assertionTimeLimit);

    // Response/Assertion/Conditions
    ConditionsType conditions = assertion.addNewConditions();
    conditions.setNotBefore(Calendar.getInstance());
    conditions.setNotOnOrAfter(Calendar.getInstance());
    AudienceRestrictionType audienceRestriction = conditions.addNewAudienceRestriction();
    audienceRestriction.addAudience(spEntityID);
    Utils.zuluXmlObject(conditions, assertionTimeLimit);

    // Response/Assertion/AuthnStatement
    AuthnStatementType authnStatement = assertion.addNewAuthnStatement();
    authnStatement.setAuthnInstant(Calendar.getInstance());
    authnStatement.setSessionIndex("");
    authnStatement.addNewSubjectLocality().setAddress(request.getLocalAddr());
    authnStatement.addNewAuthnContext().setAuthnContextClassRef(SAML.URN_SAML2_PASSWORD_PROTECTED_TRANSPORT);
    authnStatement.setSessionIndex("860e1c78883a682e07697c494b0ff1641847b128ec28cc8b597fb");
    Utils.zuluXmlObject(authnStatement, 0);

    // Assemble the attributes
    UserAttributesDocument attributesDoc = UserAttributesDocument.Factory.newInstance();
    UserAttributesDocument.UserAttributes attributes = attributesDoc.addNewUserAttributes();
    for (org.guanxi.idp.farm.attributors.Attributor attr : attributor) {
        attr.getAttributes(gxPrincipal, spEntityID, arpEngine, mapper, attributes);
    }
    AttributeStatementDocument attrStatementDoc = getSAML2AttributeStatementFromFarm(attributesDoc, spEntityID,
            subject, gxPrincipal);

    // If a user has no attributes we shouldn't add an Assertion or Subject
    if (attrStatementDoc != null) {
        // Response/Assertion/AttributeStatement
        assertion.setAttributeStatementArray(
                new AttributeStatementType[] { attrStatementDoc.getAttributeStatement() });
    }

    // Sort out the namespaces for saving the Response
    xmlOptions.setSaveSuggestedPrefixes(saml2Namespaces);

    // Debug syphoning?
    if (idpConfig.getDebug() != null) {
        if (idpConfig.getDebug().getSypthonAttributeAssertions() != null) {
            if (idpConfig.getDebug().getSypthonAttributeAssertions().equals("yes")) {
                logger.info("=======================================================");
                logger.info("Response to SAML2 WBSSO request by " + spEntityID);
                logger.info("");
                StringWriter sw = new StringWriter();
                responseDoc.save(sw, xmlOptions);
                assertionDoc.save(sw, xmlOptions);
                logger.info(sw.toString());
                logger.info("");
                logger.info("=======================================================");
            }
        }
    }

    if (encryptAttributes) {
        // Get the SP's encryption key. We'll use this to encrypt the secret key for encrypting the attributes
        X509Certificate encryptionCert = getX509CertFromMetadata(getSPMetadata(spEntityID), ENTITY_SP,
                ENCRYPTION_CERT);
        if (encryptionCert != null) {
            addEncryptedAssertionsToResponse(encryptionCert, assertionDoc, responseDoc);
        } else {
            logger.warn("Attribute encryption is on but " + spEntityID + " has no encryption key");
            responseDoc.getResponse().addNewAssertion();
            responseDoc.getResponse().setAssertionArray(0, assertionDoc.getAssertion());
        }
    } else {
        responseDoc.getResponse().addNewAssertion();
        responseDoc.getResponse().setAssertionArray(0, assertionDoc.getAssertion());
    }

    // Break out to DOM land to get the SAML Response signed...
    Document signedDoc = null;
    if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_POST)) {
        try {
            // Need to use newDomNode to preserve namespace information
            signedDoc = SecUtils.getInstance().saml2Sign(secUtilsConfig,
                    (Document) responseDoc.newDomNode(xmlOptions), responseDoc.getResponse().getID());
        } catch (GuanxiException ge) {
            logger.error("Could not sign Response", ge);
            mAndV.setViewName(errorView);
            mAndV.getModel().put(errorViewDisplayVar,
                    messages.getMessage("error.could.not.sign.message", null, request.getLocale()));
            return mAndV;
        }
    }

    // Do the binding quickstep
    String b64SAMLResponse = null;
    if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_POST)) {
        b64SAMLResponse = Utils.base64(signedDoc);
        mAndV.setViewName(httpPOSTView);
    } else if (request.getAttribute("responseBinding").equals(SAML.SAML2_BINDING_HTTP_REDIRECT)) {
        String deflatedResponse = Utils.deflate(responseDoc.toString(), Utils.RFC1951_DEFAULT_COMPRESSION_LEVEL,
                Utils.RFC1951_NO_WRAP);
        b64SAMLResponse = Utils.base64(deflatedResponse.getBytes());
        b64SAMLResponse = b64SAMLResponse.replaceAll(System.getProperty("line.separator"), "");
        b64SAMLResponse = URLEncoder.encode(b64SAMLResponse, "UTF-8");
        mAndV.setViewName(httpRedirectView);
    }

    // Send the Response to the SP
    request.setAttribute("SAMLResponse", b64SAMLResponse);
    request.setAttribute("RelayState", request.getParameter("RelayState"));
    mAndV.getModel().put("wbsso_acs_endpoint", request.getAttribute("acsURL"));
    return mAndV;
}

From source file:org.apache.camel.component.websocket.SignalkWebSocketServlet.java

public void init() throws ServletException {
    try {// w ww  .j  ava  2s  . c om
        String bs = getInitParameter("bufferSize");
        if (logger.isDebugEnabled())
            logger.debug("Upgrade ws, create factory:");
        this._webSocketFactory = new WebSocketFactory(this, (bs == null) ? 8192 : Integer.parseInt(bs)) {
            private WebSocketBuffers _buffers = new WebSocketBuffers(8192);
            private Map<WebSocketServletConnection, String> sessionMap = new HashMap<WebSocketServletConnection, String>();

            public void upgrade(HttpServletRequest request, HttpServletResponse response, WebSocket websocket,
                    String protocol) throws IOException {
                String sessionId = request.getRequestedSessionId();
                if (logger.isDebugEnabled())
                    logger.debug("Upgrade ws, requested sessionId:" + sessionId);
                if (StringUtils.isBlank(sessionId)) {
                    sessionId = request.getSession().getId();
                    if (logger.isDebugEnabled())
                        logger.debug("Request.sessionId:" + sessionId);

                }
                if (StringUtils.isBlank(sessionId)) {
                    sessionId = ((DefaultWebsocket) websocket).getConnectionKey();
                    if (logger.isDebugEnabled())
                        logger.debug("Request.wsSessionId:" + sessionId);

                }

                if (!("websocket".equalsIgnoreCase(request.getHeader("Upgrade"))))
                    throw new IllegalStateException("!Upgrade:websocket");
                if (!("HTTP/1.1".equals(request.getProtocol()))) {
                    throw new IllegalStateException("!HTTP/1.1");
                }
                int draft = request.getIntHeader("Sec-WebSocket-Version");
                if (draft < 0) {
                    draft = request.getIntHeader("Sec-WebSocket-Draft");
                }

                int requestedVersion = draft;
                AbstractHttpConnection http = AbstractHttpConnection.getCurrentConnection();
                if (http instanceof BlockingHttpConnection)
                    throw new IllegalStateException("Websockets not supported on blocking connectors");
                ConnectedEndPoint endp = (ConnectedEndPoint) http.getEndPoint();

                List<String> extensions_requested = new ArrayList<>();

                Enumeration<String> e = request.getHeaders("Sec-WebSocket-Extensions");
                while (e.hasMoreElements()) {
                    QuotedStringTokenizer tok = new QuotedStringTokenizer((String) e.nextElement(), ",");
                    while (tok.hasMoreTokens()) {
                        extensions_requested.add(tok.nextToken());
                    }

                }

                if (draft < getMinVersion())
                    draft = 2147483647;

                WebSocketServletConnection connection;
                switch (draft) {
                case -1:
                case 0:
                    connection = new WebSocketServletConnectionD00(this, websocket, endp, this._buffers,
                            http.getTimeStamp(), (int) getMaxIdleTime(), protocol);
                    break;
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    connection = new WebSocketServletConnectionD06(this, websocket, endp, this._buffers,
                            http.getTimeStamp(), (int) getMaxIdleTime(), protocol);
                    break;
                case 7:
                case 8:
                    List<Extension> extensions = initExtensions(extensions_requested, 5, 5, 3);
                    connection = new WebSocketServletConnectionD08(this, websocket, endp, this._buffers,
                            http.getTimeStamp(), (int) getMaxIdleTime(), protocol, extensions, draft);
                    break;
                case 13:
                    List<Extension> extensions1 = initExtensions(extensions_requested, 5, 5, 3);
                    connection = new WebSocketServletConnectionRFC6455(this, websocket, endp, this._buffers,
                            http.getTimeStamp(), (int) getMaxIdleTime(), protocol, extensions1, draft);
                    break;
                case 9:
                case 10:
                case 11:
                case 12:
                default:
                    String versions = "13";
                    if (getMinVersion() <= 8)
                        versions = new StringBuilder().append(versions).append(", 8").toString();
                    if (getMinVersion() <= 6)
                        versions = new StringBuilder().append(versions).append(", 6").toString();
                    if (getMinVersion() <= 0) {
                        versions = new StringBuilder().append(versions).append(", 0").toString();
                    }
                    response.setHeader("Sec-WebSocket-Version", versions);

                    StringBuilder err = new StringBuilder();
                    err.append("Unsupported websocket client version specification ");
                    if (requestedVersion >= 0)
                        err.append("[").append(requestedVersion).append("]");
                    else {
                        err.append("<Unspecified, likely a pre-draft version of websocket>");
                    }
                    err.append(", configured minVersion [").append(getMinVersion()).append("]");
                    err.append(", reported supported versions [").append(versions).append("]");
                    // LOG.warn(err.toString(), new Object[0]);

                    throw new HttpException(400, "Unsupported websocket version specification");
                }

                addConnection(connection);

                connection.getConnection().setMaxBinaryMessageSize(getMaxBinaryMessageSize());
                connection.getConnection().setMaxTextMessageSize(getMaxTextMessageSize());

                connection.handshake(request, response, protocol);
                response.flushBuffer();

                connection.fillBuffersFrom(((HttpParser) http.getParser()).getHeaderBuffer());
                connection.fillBuffersFrom(((HttpParser) http.getParser()).getBodyBuffer());
                String wsSession = ((DefaultWebsocket) websocket).getConnectionKey();
                //if(logger.isDebugEnabled())logger.debug("Upgraded session " + request.getSession().getId() + " to ws " + ((DefaultWebsocket) websocket).getConnectionKey());
                if (logger.isDebugEnabled())
                    logger.debug("Upgraded session " + sessionId + " to ws " + wsSession + " from remote ip:"
                            + request.getRemoteAddr());
                try {
                    sessionMap.put(connection, wsSession);
                    SubscriptionManagerFactory.getInstance().add(sessionId, wsSession,
                            ConfigConstants.OUTPUT_WS, request.getLocalAddr(), request.getRemoteAddr());
                    //add default sub, or specific sub here, all instant policy
                    String subscribe = request.getParameter("subscribe");
                    if (StringUtils.isBlank(subscribe) || "self".equals(subscribe)) {
                        //subscribe to self
                        String sub = "{\"context\":\"vessels.self\",\"subscribe\":[{\"path\":\"*\", \"policy\":\"instant\"}]}";
                        sendSub(request, sub, wsSession);
                    } else if ("all".equals(subscribe)) {
                        //subscribe to all
                        String sub = "{\"context\":\"vessels.*\",\"subscribe\":[{\"path\":\"*\", \"policy\":\"instant\"}]}";
                        sendSub(request, sub, wsSession);
                    } else if ("none".equals(subscribe)) {
                        //subscribe to none - do nothing
                    }

                } catch (Exception e1) {
                    logger.error(e1.getMessage(), e1);
                    throw new IOException(e1);
                }
                // LOG.debug("Websocket upgrade {} {} {} {}", new Object[] { request.getRequestURI(), Integer.valueOf(draft), protocol, connection });
                request.setAttribute("org.eclipse.jetty.io.Connection", connection);
                connection.getConnection().sendMessage(Util.getWelcomeMsg().toString());
            }

            private void sendSub(HttpServletRequest request, String sub, String wsSession) throws Exception {
                Map<String, Object> headers = new HashMap<>();
                headers.put(MSG_SRC_IP, request.getRemoteAddr());
                headers.put(MSG_SRC_IP_PORT, request.getRemotePort());

                if (Util.sameNetwork(request.getLocalAddr(), request.getRemoteAddr())) {
                    headers.put(MSG_TYPE, INTERNAL_IP);
                } else {
                    headers.put(MSG_TYPE, EXTERNAL_IP);
                }
                headers.put(WebsocketConstants.CONNECTION_KEY, wsSession);
                if (logger.isDebugEnabled())
                    logger.debug("Sending connection sub:" + sub);
                producer.sendBodyAndHeaders(RouteManager.SEDA_INPUT, sub, headers);

            }

            @Override
            protected boolean removeConnection(WebSocketServletConnection connection) {
                //unsubscribe and remove websocket session
                String wsSession = sessionMap.get(connection);
                if (logger.isDebugEnabled())
                    logger.debug("Ended wsSession " + wsSession);
                try {
                    SubscriptionManagerFactory.getInstance().removeWsSession(wsSession);
                } catch (Exception e1) {
                    logger.error(e1.getMessage(), e1);
                }
                return super.removeConnection(connection);
            }

        };
        this._webSocketFactory.setMaxTextMessageSize(256 * 1024);
        this._webSocketFactory.start();

        String max = getInitParameter("maxIdleTime");
        if (max != null) {
            this._webSocketFactory.setMaxIdleTime(Integer.parseInt(max));
        }
        max = getInitParameter("maxTextMessageSize");
        if (max != null) {
            this._webSocketFactory.setMaxTextMessageSize(Integer.parseInt(max));
        }
        max = getInitParameter("maxBinaryMessageSize");
        if (max != null) {
            this._webSocketFactory.setMaxBinaryMessageSize(Integer.parseInt(max));
        }
        String min = getInitParameter("minVersion");
        if (min != null)
            this._webSocketFactory.setMinVersion(Integer.parseInt(min));
    } catch (ServletException x) {
        throw x;
    } catch (Exception x) {
        throw new ServletException(x);
    }
}

From source file:com.esd.cs.worker.WorkerController.java

/**
 * ?/*w  ww.  java  2  s. c o  m*/
 */
@RequestMapping(value = "/importworker", method = RequestMethod.POST)
public ModelAndView importworker(HttpServletRequest request, HttpServletResponse response,
        HttpSession session) {
    Integer userId = Integer.parseInt(session.getAttribute(Constants.USER_ID).toString());
    // ??????workerTemp?
    wtService.deleteByUserId(userId);
    logger.debug("importWorker:{}");
    // ?
    String upload = "upload";
    String workerFolder = "worker";
    String url = request.getServletContext().getRealPath("/");
    String upLoadPath = url + upload + File.separator + workerFolder + File.separator;
    File uploadPath = new File(url + "upload");
    File tempPath = new File(uploadPath + File.separator + workerFolder);
    //  
    if (!uploadPath.exists()) {
        logger.debug(upload + " Does not exist,Create " + upload + " Folder");
        uploadPath.mkdir();
    }
    if (!tempPath.exists()) {
        logger.debug(workerFolder + " Does not exist,Create " + workerFolder + " Folder");
        tempPath.mkdir();
    }

    // 
    Map<String, String> paramMap = importfile(upLoadPath, request, response);
    String fileError = paramMap.get("fileError");// ?
    if (fileError != null) {
        // ?
        request.setAttribute("errorInfo", fileError);
        return new ModelAndView("basicInfo/worker_importInfo");
    }
    // ??
    String filePath = paramMap.get("filePath");// 
    Integer companyId = Integer.valueOf(paramMap.get("companyId"));// companyID
    String year = paramMap.get("year");// 
    AuditParameter auditParameter = auditParameterService.getByYear(year);
    // ??

    // List<Worker> workerErrorList = new ArrayList<Worker>();// ?
    // List<Worker> workerCorrectList = new ArrayList<Worker>();// ?
    List<Worker> list = null;

    if (fileError == null) {
        try {
            File f = new File(filePath);
            // ?excel
            list = WorkerUtil.parse(f, 0);
            // ??
            workerCount = list.size();
            if (list == null || list.size() <= 0) {
                // excel??
                logger.error("importWorkerError:{}", WORDERROR);
                request.setAttribute("errorInfo", WORDERROR);
                // ??
                return new ModelAndView("basicInfo/worker_importInfo");
            }
            for (int i = 0; i < list.size(); i++) {
                // 
                WorkerTemp t = new WorkerTemp();
                t.setUserId(userId);
                // false--????
                t.setIsOk(false);
                Worker w = null;
                // ??
                currentCount = i + 1;
                try {
                    Worker worker = list.get(i);
                    // 
                    String workerHandicapCode = worker.getWorkerHandicapCode();
                    // ??
                    String workerName = worker.getWorkerName().replace(" ", "");// 
                    w = new Worker();
                    w.setWorkerName(worker.getWorkerName());
                    w.setWorkerHandicapCode(workerHandicapCode);
                    // 
                    t.setWorkerName(workerName);
                    t.setWorkerHandicapCode(workerHandicapCode);
                    // 1.???
                    if (StringUtils.isEmpty(workerName) || StringUtils.equals(workerName, "null")) {
                        // ?
                        w.setRemark(NAMENULL);
                        // workerErrorList.add(w);
                        t.setRemark(NAMENULL);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, NAMENULL);
                        continue;
                    }
                    // 2.??
                    if (workerName.length() > 20) {
                        // ?
                        w.setRemark("???");
                        // workerErrorList.add(w);
                        t.setRemark("???");
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, "???");
                        continue;
                    }
                    // 3.???
                    if (StringUtils.isBlank(workerHandicapCode)
                            || StringUtils.equals(workerHandicapCode, "null")) {
                        // ?
                        w.setRemark(LENGTHERROR);
                        // workerErrorList.add(w);
                        t.setRemark(LENGTHERROR);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, LENGTHERROR);
                        continue;
                    }
                    // ??
                    workerHandicapCode.replace(" ", "");// 
                    // 4.??
                    if (workerHandicapCode.length() < MIN_HANDICAPCODE
                            || workerHandicapCode.length() > MAX_HANDICAPCODE) {
                        // ?
                        w.setRemark(LENGTHERROR);
                        // workerErrorList.add(w);
                        t.setRemark(LENGTHERROR);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, LENGTHERROR);
                        continue;
                    }
                    // 5.????
                    if (CommonUtil.chineseValid(workerHandicapCode)) {
                        // ?
                        w.setRemark(ILLEGALSTR);
                        // workerErrorList.add(w);
                        t.setRemark(ILLEGALSTR);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, LENGTHERROR);
                        continue;
                    }
                    // 6.20??
                    String handicapStr = workerHandicapCode.substring(0, 19);
                    if (!handicapStr.matches("\\d+")) {
                        w.setRemark("???20??");
                        // workerErrorList.add(w);
                        t.setRemark("???20??");
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, TYPEERROR);
                        continue;
                    }
                    // 7.
                    String handicapTypeStr = workerHandicapCode.substring(18, 19);
                    boolean ishandicapType = handicapTypeStr.matches("\\d+");// true,??
                    // 8.?
                    if (ishandicapType) {
                        int handicapType = Integer.valueOf(handicapTypeStr);
                        if (handicapType > 7 || handicapType == 0) {
                            w.setRemark(TYPEERROR);
                            // workerErrorList.add(w);
                            t.setRemark(TYPEERROR);
                            wtService.save(t);
                            logger.error("impoerWorkerError:{},info:{}", w, TYPEERROR);
                            continue;
                        }
                    }

                    // 9.??
                    String handicapLevelStr = workerHandicapCode.substring(19, 20);
                    boolean ishandicapLevel = handicapLevelStr.matches("\\d+");// true,??
                    if (ishandicapLevel) {
                        int handicapLevel = Integer.valueOf(handicapLevelStr);
                        if (handicapLevel > 4 || handicapLevel == 0) {
                            w.setRemark(LEVELERROR);
                            // workerErrorList.add(w);
                            t.setRemark(LEVELERROR);
                            wtService.save(t);
                            logger.error("impoerWorkerError:{},info:{}", w, LEVELERROR);
                            continue;
                        }
                    }

                    // 10.?
                    List<String> ageResult = new WorkerUtil().ageVerifi(workerHandicapCode, auditParameter);
                    if (ageResult != null) {
                        String ageErrorInfo = "" + ageResult.get(0).toString()
                                + "," + ageResult.get(1).toString() + ""
                                + ageResult.get(2).toString();
                        w.setRemark(ageErrorInfo);
                        // workerErrorList.add(w);
                        t.setRemark(ageErrorInfo);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, ageErrorInfo);
                        continue;
                    }

                    // 11.????
                    List<Map<String, String>> validateList = validateOrganizationCode(
                            workerHandicapCode.substring(0, 18), year);
                    Map<String, String> validateResult = validateList.get(0);
                    logger.debug("LineNumber:{},validataType:{}", i, validateResult.get("type"));
                    // 12.? ?
                    if (StringUtils.equals(validateResult.get("type"), "1")) {
                        // ?
                        String errinfo = "?" + validateList.get(1).get("companyName")
                                + " ?????"
                                + validateList.get(1).get("companyCode");
                        w.setRemark(errinfo);
                        // workerErrorList.add(w);
                        t.setRemark(errinfo);
                        wtService.save(t);
                        logger.error("impoerWorkerError:{},info:{}", w, errinfo);
                        continue;
                    }
                    // .???? ? ??
                    if (StringUtils.equals(validateResult.get("type"), "2")
                            || StringUtils.equals(validateResult.get("type"), "3")) {
                        Worker workerUp = new Worker();
                        workerUp.setWorkerName(worker.getWorkerName());
                        workerUp.setWorkerHandicapCode(workerHandicapCode);

                        Worker workerCorrect = WorkerUtil.assembly(workerUp);
                        // workerCorrectList.add(workerCorrect);
                        // ??? 
                        t.setWorkerName(workerCorrect.getWorkerName());
                        t.setWorkerHandicapCode(workerCorrect.getWorkerHandicapCode());
                        t.setIsOk(true);
                        t.setWorkerBirth(workerCorrect.getWorkerBirth());
                        t.setWorkerBirthYear(workerCorrect.getWorkerBirthYear());
                        t.setWorkerGender(workerCorrect.getWorkerGender());
                        t.setWorkerHandicapLevel(workerCorrect.getWorkerHandicapLevel().getId());
                        t.setWorkerHandicapType(workerCorrect.getWorkerHandicapType().getId());
                        t.setWorkerIdCard(workerCorrect.getWorkerIdCard());
                        // , ??, ?id??
                        if (StringUtils.equals(validateResult.get("type"), "2")) {
                            t.setPreId(Integer.parseInt(validateResult.get("workerId").toString()));
                        }
                        wtService.save(t);
                        continue;
                    }
                } catch (Exception e) {
                    w.setRemark("");
                    // workerErrorList.add(w);
                    t.setRemark("");
                    wtService.save(t);
                    logger.error("impoerWorkerUpError:{}", "false");
                }
            }
            // ?

            // ??
            List<WorkerTemp> workerErrorList = wtService.getByCheck(false, userId);// ?
            if (workerErrorList.size() != 0) {
                String errorFilePath = upLoadPath + companyId + ".xls";
                // ??
                if (PoiCreateExcel.createExcel(errorFilePath, workerErrorList)) {
                    logger.debug("upLoadErrorListCreateSuccess!");
                    String destPath = request.getLocalAddr() + ":" + request.getLocalPort()
                            + request.getContextPath();
                    // ?
                    request.setAttribute("errorFilePath", "http://" + destPath + "/" + upload + "/"
                            + workerFolder + "/" + companyId + ".xls");//
                } else {
                    logger.error("upLoadErrorListCreateError");
                    request.setAttribute("errorInfo", CREATEERRORFILE);
                }
            }
            // 
            f.delete();

            // int totalLength = wtService.getCountByCheck(null, userId,
            // null);
            // int succesLength = wtService.getCountByCheck(true, userId,
            // null);
            // int errorLength = totalLength - succesLength;
            int totalLength = 0;
            int succesLength = 0;
            int errorLength = 0;
            // ??
            if (workerErrorList != null) {
                errorLength = workerErrorList.size();
            }
            // // ??
            if (list != null) {
                totalLength = list.size();
                succesLength = totalLength - errorLength;
            }
            request.setAttribute("totalLength", totalLength);// ?
            request.setAttribute("errorLength", errorLength);// ?
            request.setAttribute("succesLength", succesLength);// ??
            // request.setAttribute("workerCorrectList", workerCorrectList);
            // //?, ???
            // // ??
            request.setAttribute("errorInfo", "null");// ??
            request.setAttribute("companyId", companyId);// ??iD
            request.setAttribute("year", year);// 

            logger.debug("totalLength:{}", totalLength);// ?
            logger.debug("errorLength:{}", errorLength);// ?
            logger.debug("succesLength:{}", succesLength);// ??

            // ?
            list.clear();
            list = null;
            workerErrorList.clear();// ?
            workerErrorList = null;

        } catch (IllegalStateException e) {
            e.printStackTrace();
            logger.error("importWorkerError:{}", e.getMessage());
        } catch (IOException e) {
            logger.error("importWorkerError:{}", e.getMessage());
        }
    }

    // ??
    return new ModelAndView("basicInfo/worker_importInfo");
}

From source file:org.apache.jsp.webpage.modules.gen.genTableForm_jsp.java

public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {
    String _jspx_method = request.getMethod();
    if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method)
            && !DispatcherType.ERROR.equals(request.getDispatcherType())) {
        response.sendError(405, "JSPs only permit GET POST or HEAD");
    } else {//w ww . j  av  a2 s. co  m
        Object out = null;
        Object _jspx_out = null;
        PageContext _jspx_page_context = null;

        try {
            try {
                response.setContentType("text/html;charset=UTF-8");
                PageContext pageContext = _jspxFactory.getPageContext(this, request, response, (String) null,
                        true, 8192, true);
                _jspx_page_context = pageContext;
                pageContext.getServletContext();
                pageContext.getServletConfig();
                pageContext.getSession();
                out = pageContext.getOut();
                ((JspWriter) out).write(10);
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                if (this._jspx_meth_c_005fset_005f0(pageContext)) {
                    return;
                }

                ((JspWriter) out).write(10);
                if (this._jspx_meth_c_005fset_005f1(pageContext)) {
                    return;
                }

                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("<html>\n");
                ((JspWriter) out).write("<head>\n");
                ((JspWriter) out).write("\t<title>??</title>\n");
                ((JspWriter) out).write("\t<meta name=\"decorator\" content=\"default\"/>\n");
                ((JspWriter) out).write("\t<script type=\"text/javascript\" src=\"");
                ((JspWriter) out).write((String) PageContextImpl.proprietaryEvaluate("${ctxStatic}",
                        String.class, pageContext, (ProtectedFunctionMapper) null));
                ((JspWriter) out).write("/jquery-combox/jquery.combox.js\"></script>\n");
                ((JspWriter) out).write("\t<link rel=\"stylesheet\" href=\"");
                ((JspWriter) out).write((String) PageContextImpl.proprietaryEvaluate("${ctxStatic}",
                        String.class, pageContext, (ProtectedFunctionMapper) null));
                ((JspWriter) out).write("/jquery-combox/styles/style.css\" type=\"text/css\"/>\n");
                ((JspWriter) out).write("\t<script type=\"text/javascript\">\n");
                ((JspWriter) out).write(
                        "\tvar validateForm;function doSubmit(){return validateForm.form()?($(\"#inputForm\").submit(),!0):!1};$(document).ready(function(){validateForm=$(\"#inputForm\").validate({ignore:\"\",submitHandler:function(a){loading(\"\\u6b63\\u5728\\u63d0\\u4ea4\\uff0c\\u8bf7\\u7a0d\\u7b49...\");$(\"input[type=checkbox]\").each(function(){$(this).after(\'<input type=\"hidden\" name=\"\'+$(this).attr(\"name\")+\'\" value=\"\'+($(this).attr(\"checked\")?\"1\":\"0\")+\'\"/>\');$(this).attr(\"name\",\"_\"+$(this).attr(\"name\"))});a.submit()},errorContainer:\"#messageBox\",errorPlacement:function(a,b){$(\"#messageBox\").text(\"\\u8f93\\u5165\\u6709\\u8bef\\uff0c\\u8bf7\\u5148\\u66f4\\u6b63\\u3002\");b.is(\":checkbox\")||b.is(\":radio\")||b.parent().is(\".input-append\")?a.appendTo(b.parent().parent()):a.insertAfter(b)}});resetColumnNo();$(\"#tableType\").change(function(){\"3\"==$(\"#tableType\").val()?addForTreeTable():removeForTreeTable()});var b,c;$(\"#contentTable1\").tableDnD({onDragClass:\"myDragClass\",onDrop:function(a,d){c=$(d).index();var f=$(\"#tab-2 #contentTable2 tbody tr:eq(\"+c+\")\"),e=$(\"#tab-2 #contentTable2 tbody tr:eq(\"+b+\")\");b<c?e.insertAfter(f):e.insertBefore(f);f=$(\"#tab-3 #contentTable3 tbody tr:eq(\"+c+\")\");e=$(\"#tab-3 #contentTable3 tbody tr:eq(\"+b+\")\");b<c?e.insertAfter(f):e.insertBefore(f);f=$(\"#tab-4 #contentTable4 tbody tr:eq(\"+c+\")\");e=$(\"#tab-4 #contentTable4 tbody tr:eq(\"+b+\")\");b<c?e.insertAfter(f):e.insertBefore(f);resetColumnNo()},onDragStart:function(a,c){b=$(c).index()}})});function resetColumnNo(){$(\"#tab-4 #contentTable4 tbody tr\").each(function(b,c){$(this).find(\"span[name*=columnList],select[name*=columnList],input[name*=columnList]\").each(function(){var a=$(this).attr(\"name\"),c=a.split(\".\")[1],c=\"columnList[\"+b+\"].\"+c;$(this).attr(\"name\",c);0<=a.indexOf(\".sort\")&&($(this).val(b),$(this).next().text(b))});$(this).find(\"label[id*=columnList]\").each(function(){var a=$(this).attr(\"id\").split(\".\")[1],a=\"columnList[\"+b+\"].\"+a;$(this).attr(\"id\",a);$(this).attr(\"for\",\"columnList[\"+b+\"].jdbcType\")});$(this).find(\"input[name*=name]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)});$(this).find(\"input[name*=comments]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)})});$(\"#tab-3 #contentTable3 tbody tr\").each(function(b,c){$(this).find(\"span[name*=columnList],select[name*=columnList],input[name*=columnList]\").each(function(){var a=$(this).attr(\"name\"),c=a.split(\".\")[1],c=\"columnList[\"+b+\"].\"+c;$(this).attr(\"name\",c);0<=a.indexOf(\".sort\")&&($(this).val(b),$(this).next().text(b))});$(this).find(\"label[id*=columnList]\").each(function(){var a=$(this).attr(\"id\").split(\".\")[1],a=\"columnList[\"+b+\"].\"+a;$(this).attr(\"id\",a);$(this).attr(\"for\",\"columnList[\"+b+\"].jdbcType\")});$(this).find(\"input[name*=name]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)});$(this).find(\"input[name*=comments]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)})});$(\"#tab-2 #contentTable2 tbody tr\").each(function(b,c){$(this).find(\"span[name*=columnList],select[name*=columnList],input[name*=columnList]\").each(function(){var a=$(this).attr(\"name\"),c=a.split(\".\")[1],c=\"columnList[\"+b+\"].\"+c;$(this).attr(\"name\",c);0<=a.indexOf(\".sort\")&&($(this).val(b),$(this).next().text(b))});$(this).find(\"label[id*=columnList]\").each(function(){var a=$(this).attr(\"id\").split(\".\")[1],a=\"columnList[\"+b+\"].\"+a;$(this).attr(\"id\",a);$(this).attr(\"for\",\"columnList[\"+b+\"].jdbcType\")});$(this).find(\"input[name*=name]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)});$(this).find(\"input[name*=comments]\").each(function(){var a=$(this).attr(\"name\").split(\".\")[1],a=\"page-columnList[\"+b+\"].\"+a;$(this).attr(\"name\",a)})});$(\"#tab-1 #contentTable1 tbody tr\").each(function(b,c){$(this).find(\"span[name*=columnList],select[name*=columnList],input[name*=columnList]\").each(function(){var a=$(this).attr(\"name\"),c=a.split(\".\")[1],c=\"columnList[\"+b+\"].\"+c;$(this).attr(\"name\",c);0<=a.indexOf(\".sort\")&&($(this).val(b),$(this).next().text(b))});$(this).find(\"label[id*=columnList]\").each(function(){var a=$(this).attr(\"id\").split(\".\")[1],a=\"columnList[\"+b+\"].\"+a;$(this).attr(\"id\",a);$(this).attr(\"for\",\"columnList[\"+b+\"].jdbcType\")});$(this).find(\"input[name*=name]\").change(function(){var a=\"page-\"+$(this).attr(\"name\");$(\"#tab-2 #contentTable2 tbody tr input[name=\'\"+a+\"\']\").val($(this).val());$(\"#tab-3 #contentTable3 tbody tr input[name=\'\"+a+\"\']\").val($(this).val());$(\"#tab-4 #contentTable4 tbody tr input[name=\'\"+a+\"\']\").val($(this).val())});$(this).find(\"input[name*=comments]\").change(function(){var a=\"page-\"+$(this).attr(\"name\");$(\"#tab-2 #contentTable2 tbody tr input[name=\'\"+a+\"\']\").val($(this).val());$(\"#tab-3 #contentTable3 tbody tr input[name=\'\"+a+\"\']\").val($(this).val());$(\"#tab-4 #contentTable4 tbody tr input[name=\'\"+a+\"\']\").val($(this).val())})});$(\"#contentTable1 tbody tr span[name*=jdbcType]\").combox({datas:\"varchar(64) nvarchar(64) integer double datetime longblob longtext\".split(\" \")});$(\"#contentTable2 tbody tr select[name*=javaType]\").change(function(){var b=$(this).children(\"option:selected\").val(),c=$(this);if(\"Custom\"==b||\"newadd\"==$(this).children(\"option:selected\").attr(\"class\"))top.layer.open({type:1,title:\"\\u8f93\\u5165\\u81ea\\u5b9a\\u4e49java\\u5bf9\\u8c61\",area:[\"600px\",\"360px\"],shadeClose:!0,content:\'<div class=\"wrapper wrapper-content\"><div class=\"col-md-12\"><div class=\"form-group\"> <label class=\"col-sm-3 control-label\">\\u5305\\u540d\\uff1a</label> <div class=\"col-sm-9\"> <input type=\"text\" id=\"packagePath\" name=\"\" class=\"form-control required\" placeholder=\"\\u8bf7\\u8f93\\u5165\\u81ea\\u5b9a\\u4e49\\u5bf9\\u8c61\\u6240\\u5728\\u7684\\u5305\\u8def\\u5f84\"> <span class=\"help-block m-b-none\">\\u5fc5\\u987b\\u662f\\u5b58\\u5728\\u7684package</span> </div> </div> <div class=\"form-group\"> <label class=\"col-sm-3 control-label\">\\u7c7b\\u540d\\uff1a</label> <div class=\"col-sm-9\"> <input type=\"text\" id=\"className\" name=\"\" class=\"form-control required\" placeholder=\"\\u8bf7\\u8f93\\u5165\\u81ea\\u5b9a\\u4e49\\u5bf9\\u8c61\\u7684\\u7c7b\\u540d\"> <span class=\"help-block m-b-none\">\\u5fc5\\u987b\\u662f\\u5b58\\u5728\\u7684class\\u5bf9\\u8c61</span> </div> </div></div></div>\',btn:[\"\\u786e\\u5b9a\",\"\\u5173\\u95ed\"],yes:function(a,b){var f=top.$(\"#packagePath\").val(),e=top.$(\"#className\").val(),g=f+\".\"+e;top.$(\"<option>\").val(g).text(e);\"\"==e.trim()||\"\"==f.trim()?top.layer.alert(\"\\u5305\\u540d\\u548c\\u7c7b\\u540d\\u90fd\\u4e0d\\u5141\\u8bb8\\u4e3a\\u7a7a!\",{icon:0}):(c.children(\"option:selected\").text(e),c.children(\"option:selected\").val(g),c.children(\"option:selected\").attr(\"class\",\"newadd\"),top.layer.close(a))},cancel:function(a){}}),\"Custom\"!=b&&\"newadd\"==$(this).children(\"option:selected\").attr(\"class\")&&(top.$(\"#packagePath\").val($(this).children(\"option:selected\").val().substring(0,$(this).children(\"option:selected\").val().lastIndexOf(\".\"))),top.$(\"#className\").val($(this).children(\"option:selected\").text()))})};function addColumn(){var b=$(\"#template1\").clone();b.removeAttr(\"style\");b.removeAttr(\"id\");var c=$(\"#template2\").clone();c.removeAttr(\"style\");c.removeAttr(\"id\");var a=$(\"#template3\").clone();a.removeAttr(\"style\");a.removeAttr(\"id\");var d=$(\"#template4\").clone();d.removeAttr(\"style\");d.removeAttr(\"id\");$(\"#tab-1 #contentTable1 tbody\").append(b);$(\"#tab-2 #contentTable2 tbody\").append(c);$(\"#tab-3 #contentTable3 tbody\").append(a);$(\"#tab-4 #contentTable4 tbody\").append(d);b.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});c.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});a.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});d.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});resetColumnNo();$(\"#contentTable1\").tableDnD({onDragClass:\"myDragClass\",onDrop:function(a,b){toIndex=$(b).index();var c=$(\"#tab-2 #contentTable2 tbody tr:eq(\"+toIndex+\")\"),d=$(\"#tab-2 #contentTable2 tbody tr:eq(\"+fromIndex+\")\");fromIndex<toIndex?d.insertAfter(c):d.insertBefore(c);c=$(\"#tab-3 #contentTable3 tbody tr:eq(\"+toIndex+\")\");d=$(\"#tab-3 #contentTable3 tbody tr:eq(\"+fromIndex+\")\");fromIndex<toIndex?d.insertAfter(c):d.insertBefore(c);c=$(\"#tab-4 #contentTable4 tbody tr:eq(\"+toIndex+\")\");d=$(\"#tab-4 #contentTable4 tbody tr:eq(\"+fromIndex+\")\");fromIndex<toIndex?d.insertAfter(c):d.insertBefore(c);resetColumnNo()},onDragStart:function(a,b){fromIndex=$(b).index()}});return!1};function removeForTreeTable(){$(\"#tab-1 #contentTable1 tbody\").find(\"#tree_11,#tree_12,#tree_13,#tree_14\").remove();$(\"#tab-2 #contentTable2 tbody\").find(\"#tree_21,#tree_22,#tree_23,#tree_24\").remove();$(\"#tab-3 #contentTable3 tbody\").find(\"#tree_31,#tree_32,#tree_33,#tree_34\").remove();$(\"#tab-4 #contentTable4 tbody\").find(\"#tree_41,#tree_42,#tree_43,#tree_44\").remove();resetColumnNo();return!1};function addForTreeTable(){if(!$(\"#tab-1 #contentTable1 tbody\").find(\"input[name*=name][value=parent_id]\").val()){var b=$(\"#template1\").clone();b.removeAttr(\"style\");b.attr(\"id\",\"tree_11\");b.find(\"input[name*=name]\").val(\"parent_id\");b.find(\"input[name*=comments]\").val(\"\\u7236\\u7ea7\\u7f16\\u53f7\");b.find(\"span[name*=jdbcType]\").val(\"varchar(64)\");var c=$(\"#template2\").clone();c.removeAttr(\"style\");c.attr(\"id\",\"tree_21\");c.find(\"input[name*=name]\").val(\"parent_id\");c.find(\"select[name*=javaType]\").val(\"This\");c.find(\"input[name*=javaField]\").val(\"parent.id|name\");c.find(\"input[name*=isList]\").removeAttr(\"checked\");c.find(\"select[name*=showType]\").val(\"treeselect\");var a=$(\"#template3\").clone();a.removeAttr(\"style\");a.attr(\"id\",\"tree_31\");a.find(\"input[name*=name]\").val(\"parent_id\");var d=$(\"#template4\").clone();d.removeAttr(\"style\");d.attr(\"id\",\"tree_41\");d.find(\"input[name*=name]\").val(\"parent_id\");d.find(\"input[name*=isNull]\").removeAttr(\"checked\");$(\"#tab-1 #contentTable1 tbody\").append(b);$(\"#tab-2 #contentTable2 tbody\").append(c);$(\"#tab-3 #contentTable3 tbody\").append(a);$(\"#tab-4 #contentTable4 tbody\").append(d);b.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});c.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});a.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"});d.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"})};$(\"#tab-1 #contentTable1 tbody\").find(\"input[name*=name][value=parent_ids]\").val()||(b=$(\"#template1\").clone(),b.removeAttr(\"style\"),b.attr(\"id\",\"tree_12\"),b.find(\"input[name*=name]\").val(\"parent_ids\"),b.find(\"input[name*=comments]\").val(\"\\u6240\\u6709\\u7236\\u7ea7\\u7f16\\u53f7\"),b.find(\"span[name*=jdbcType]\").val(\"varchar(2000)\"),c=$(\"#template2\").clone(),c.removeAttr(\"style\"),c.attr(\"id\",\"tree_22\"),c.find(\"input[name*=name]\").val(\"parent_ids\"),c.find(\"select[name*=javaType]\").val(\"String\"),c.find(\"input[name*=javaField]\").val(\"parentIds\"),c.find(\"select[name*=queryType]\").val(\"like\"),c.find(\"input[name*=isList]\").removeAttr(\"checked\"),a=$(\"#template3\").clone(),a.removeAttr(\"style\"),a.attr(\"id\",\"tree_32\"),a.find(\"input[name*=name]\").val(\"parent_ids\"),d=$(\"#template4\").clone(),d.removeAttr(\"style\"),d.attr(\"id\",\"tree_42\"),d.find(\"input[name*=name]\").val(\"parent_ids\"),d.find(\"input[name*=isNull]\").removeAttr(\"checked\"),$(\"#tab-1 #contentTable1 tbody\").append(b),$(\"#tab-2 #contentTable2 tbody\").append(c),$(\"#tab-3 #contentTable3 tbody\").append(a),$(\"#tab-4 #contentTable4 tbody\").append(d),b.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),c.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),a.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),d.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}));$(\"#tab-1 #contentTable1 tbody\").find(\"input[name*=name][value=name]\").val()||(b=$(\"#template1\").clone(),b.removeAttr(\"style\"),b.attr(\"id\",\"tree_13\"),b.find(\"input[name*=name]\").val(\"name\"),b.find(\"input[name*=comments]\").val(\"\\u540d\\u79f0\"),b.find(\"span[name*=jdbcType]\").val(\"varchar(100)\"),c=$(\"#template2\").clone(),c.removeAttr(\"style\"),c.attr(\"id\",\"tree_23\"),c.find(\"input[name*=name]\").val(\"name\"),c.find(\"select[name*=javaType]\").val(\"String\"),c.find(\"input[name*=javaField]\").val(\"name\"),c.find(\"input[name*=isQuery]\").attr(\"checked\",\"checked\"),c.find(\"select[name*=queryType]\").val(\"like\"),a=$(\"#template3\").clone(),a.removeAttr(\"style\"),a.attr(\"id\",\"tree_33\"),a.find(\"input[name*=name]\").val(\"name\"),d=$(\"#template4\").clone(),d.removeAttr(\"style\"),d.attr(\"id\",\"tree_43\"),d.find(\"input[name*=name]\").val(\"name\"),d.find(\"input[name*=isNull]\").removeAttr(\"checked\"),$(\"#tab-1 #contentTable1 tbody\").append(b),$(\"#tab-2 #contentTable2 tbody\").append(c),$(\"#tab-3 #contentTable3 tbody\").append(a),$(\"#tab-4 #contentTable4 tbody\").append(d),b.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),c.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),a.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),d.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}));$(\"#tab-1 #contentTable1 tbody\").find(\"input[name*=name][value=sort]\").val()||(b=$(\"#template1\").clone(),b.removeAttr(\"style\"),b.attr(\"id\",\"tree_14\"),b.find(\"input[name*=name]\").val(\"sort\"),b.find(\"input[name*=comments]\").val(\"\\u6392\\u5e8f\"),b.find(\"span[name*=jdbcType]\").val(\"decimal(10,0)\"),c=$(\"#template2\").clone(),c.removeAttr(\"style\"),c.attr(\"id\",\"tree_24\"),c.find(\"input[name*=name]\").val(\"sort\"),c.find(\"select[name*=javaType]\").val(\"Integer\"),c.find(\"input[name*=javaField]\").val(\"sort\"),c.find(\"input[name*=isList]\").removeAttr(\"checked\"),a=$(\"#template3\").clone(),a.removeAttr(\"style\"),a.attr(\"id\",\"tree_34\"),a.find(\"input[name*=name]\").val(\"sort\"),d=$(\"#template4\").clone(),d.removeAttr(\"style\"),d.attr(\"id\",\"tree_44\"),d.find(\"input[name*=name]\").val(\"sort\"),d.find(\"input[name*=isNull]\").removeAttr(\"checked\"),$(\"#tab-1 #contentTable1 tbody\").append(b),$(\"#tab-2 #contentTable2 tbody\").append(c),$(\"#tab-3 #contentTable3 tbody\").append(a),$(\"#tab-4 #contentTable4 tbody\").append(d),b.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),c.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),a.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}),d.find(\"input:checkbox\").iCheck({checkboxClass:\"icheckbox_square-green\",radioClass:\"iradio_square-blue\",increaseArea:\"20%\"}));resetColumnNo();return!1};function delColumn(){$(\"input[name=\'ck\']:checked\").closest(\"tr\").each(function(){var b=$(this).find(\"input[name*=name]\").attr(\"name\");$(this).remove();$(\"#tab-2 #contentTable2 tbody tr input[name=\'page-\"+b+\"\']\").closest(\"tr\").remove();$(\"#tab-3 #contentTable3 tbody tr input[name=\'page-\"+b+\"\']\").closest(\"tr\").remove();$(\"#tab-4 #contentTable4 tbody tr input[name=\'page-\"+b+\"\']\").closest(\"tr\").remove()});resetColumnNo();return!1};\t\t\n");
                ((JspWriter) out).write("\t</script>\n");
                ((JspWriter) out).write("</head>\n");
                ((JspWriter) out).write("<body>\n");
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\t");
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(32);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\t\t\n");
                ((JspWriter) out).write("\t\t");
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write(10);
                ((JspWriter) out).write(9);
                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\t\n");
                ((JspWriter) out).write("\t\n");
                ((JspWriter) out).write("\t");
                String t = this.getConfig("username");
                this.getConfig("license");
                GenTemplate template;
                if (request.getSession().getAttribute("template1") == null) {
                    template = this.getGenTemplate(GenUtils.computer, t, request.getLocalAddr());
                    request.getSession().setAttribute("template1", template);
                } else {
                    template = (GenTemplate) request.getSession().getAttribute("template1");
                }

                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\t\t\n");
                ((JspWriter) out).write("\t\t");
                if (!template.getName().equals("1")) {
                    ((JspWriter) out).write("<!-- ? -->\n");
                    ((JspWriter) out).write("\t<div class=\"wrapper wrapper-content\">\n");
                    ((JspWriter) out).write("\t\n");
                    ((JspWriter) out).write("\t<table style=\"display:none\">\n");
                    ((JspWriter) out).write("\t\t<tr id=\"template1\" style=\"display:none\">\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"hidden\" name=\"columnList[0].sort\" value=\"0\"  maxlength=\"200\" class=\"form-control required   digits\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t\t<label>0</label>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"hidden\" class=\"form-control\"  name=\"columnList[0].isInsert\" value=\"1\" />\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"hidden\" class=\"form-control\"  name=\"columnList[0].isEdit\" value=\"1\"  />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control  \" name=\"ck\" value=\"1\" />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control required\" name=\"columnList[0].name\" value=\"\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control required\" name=\"columnList[0].comments\" value=\"\" maxlength=\"200\" class=\"required\" />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<span  name=\"template_columnList[0].jdbcType\" class=\"required\" value=\"varchar(64)\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control\" name=\"columnList[0].isPk\" value=\"1\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t</tr>\n");
                    ((JspWriter) out).write("\t\t\t<tr id=\"template2\" style=\"display:none\">\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" readOnly=\"readonly\" name=\"page-columnList[0].name\" value=\"\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"page-columnList[0].comments\" value=\"\" maxlength=\"200\" readonly=\"readonly\" />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<select name=\"columnList[0].javaType\" class=\"form-control required m-b\">\n");
                    ((JspWriter) out).write("\t\t\t\t\t\t");
                    if (this._jspx_meth_c_005fforEach_005f0(pageContext)) {
                        return;
                    }

                    ((JspWriter) out).write("\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t\t\t<option value=\"Custom\"  class=\"newadd\" ></option>\n");
                    ((JspWriter) out).write("\t\t\t\t\t</select>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].javaField\" value=\"\" maxlength=\"200\" class=\"form-control required \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control  \" name=\"columnList[0].isForm\" value=\"1\" checked/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control  \" name=\"columnList[0].isList\" value=\"1\" checked/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control  \" name=\"columnList[0].isQuery\" value=\"1\"  />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<select name=\"columnList[0].queryType\" class=\"form-control required  m-b\">\n");
                    ((JspWriter) out).write("\t\t\t\t\t\t");
                    if (this._jspx_meth_c_005fforEach_005f1(pageContext)) {
                        return;
                    }

                    ((JspWriter) out).write("\n");
                    ((JspWriter) out).write("\t\t\t\t\t</select>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<select name=\"columnList[0].showType\" class=\"form-control required  m-b\">\n");
                    ((JspWriter) out).write("\t\t\t\t\t\t");
                    if (this._jspx_meth_c_005fforEach_005f2(pageContext)) {
                        return;
                    }

                    ((JspWriter) out).write("\n");
                    ((JspWriter) out).write("\t\t\t\t\t</select>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out)
                            .write("\t\t\t\t\t<input type=\"text\" name=\"columnList[0].dictType\" value=\"");
                    ((JspWriter) out).write((String) PageContextImpl.proprietaryEvaluate("${column.dictType}",
                            String.class, pageContext, (ProtectedFunctionMapper) null));
                    ((JspWriter) out).write("\" maxlength=\"200\" class=\"form-control   \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t</tr>\n");
                    ((JspWriter) out).write("\t\t\t\n");
                    ((JspWriter) out).write("\t\t\t<tr id=\"template3\" style=\"display:none\">\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" readOnly=\"readonly\" name=\"page-columnList[0].name\" value=\"\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"page-columnList[0].comments\" value=\"\" maxlength=\"200\" readonly=\"readonly\" />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].tableName\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].fieldLabels\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].fieldKeys\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].searchLabel\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].searchKey\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t\n");
                    ((JspWriter) out).write("\t\t\t</tr>\n");
                    ((JspWriter) out).write("\t\t\t\n");
                    ((JspWriter) out).write("\t\t\t<tr id=\"template4\" style=\"display:none\">\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" readOnly=\"readonly\" name=\"page-columnList[0].name\" value=\"\"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"page-columnList[0].comments\" value=\"\" maxlength=\"200\" readonly=\"readonly\" />\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"checkbox\" class=\"form-control \" name=\"columnList[0].isNull\" value=\"1\" checked/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<select name=\"columnList[0].validateType\" class=\"form-control  m-b\">\n");
                    ((JspWriter) out).write("\t\t\t\t\t\t");
                    if (this._jspx_meth_c_005fforEach_005f3(pageContext)) {
                        return;
                    }

                    ((JspWriter) out).write("\n");
                    ((JspWriter) out).write("\t\t\t\t\t</select>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].minLength\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].maxLength\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].minValue\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t<td>\n");
                    ((JspWriter) out).write(
                            "\t\t\t\t\t<input type=\"text\" name=\"columnList[0].maxValue\" value=\"\" maxlength=\"200\" class=\"form-control  \"/>\n");
                    ((JspWriter) out).write("\t\t\t\t</td>\n");
                    ((JspWriter) out).write("\t\t\t\t\n");
                    ((JspWriter) out).write("\t\t\t</tr>\n");
                    ((JspWriter) out).write("\t\n");
                    ((JspWriter) out).write("\t\n");
                    ((JspWriter) out).write("\t</table>\n");
                    ((JspWriter) out).write("\t\t\n");
                    ((JspWriter) out).write("\t\t\t<!--  -->\n");
                    ((JspWriter) out).write("\t\t\t");
                    FormTag _jspx_th_form_005fform_005f0 = (FormTag) this._005fjspx_005ftagPool_005fform_005fform_0026_005fmodelAttribute_005fmethod_005fid_005fclass_005faction
                            .get(FormTag.class);

                    try {
                        _jspx_th_form_005fform_005f0.setPageContext(_jspx_page_context);
                        _jspx_th_form_005fform_005f0.setParent((Tag) null);
                        _jspx_th_form_005fform_005f0.setId("inputForm");
                        _jspx_th_form_005fform_005f0.setModelAttribute("genTable");
                        _jspx_th_form_005fform_005f0.setAction(
                                (String) PageContextImpl.proprietaryEvaluate("${ctx}/gen/genTable/save",
                                        String.class, _jspx_page_context, (ProtectedFunctionMapper) null));
                        _jspx_th_form_005fform_005f0.setMethod("post");
                        _jspx_th_form_005fform_005f0.setDynamicAttribute((String) null, "class",
                                "form-horizontal");
                        int[] _jspx_push_body_count_form_005fform_005f0 = new int[1];

                        try {
                            int var10000;
                            int var10003;
                            try {
                                int _jspx_exception = _jspx_th_form_005fform_005f0.doStartTag();
                                int var123;
                                if (_jspx_exception != 0) {
                                    do {
                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t");
                                        if (this._jspx_meth_form_005fhidden_005f0(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t");
                                        if (this._jspx_meth_form_005fhidden_005f1(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t");
                                        if (this._jspx_meth_sys_005fmessage_005f0(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t<table class=\"table table-bordered  table-condensed dataTables-example dataTable no-footer\">\n");
                                        ((JspWriter) out).write("\t\t\t\t   <tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\"><font color=\"red\">*</font>??:</label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_form_005finput_005f0(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\"><font color=\"red\">*</font>:</label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_form_005finput_005f1(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\"></label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_form_005fselect_005f0(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<span class=\"help-inline\">???</span>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\"><font color=\"red\">*</font>??:</label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_form_005finput_005f2(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\">??:</label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        SelectTag _jspx_th_form_005fselect_005f1 = (SelectTag) this._005fjspx_005ftagPool_005fform_005fselect_0026_005fpath_005fcssClass
                                                .get(SelectTag.class);

                                        try {
                                            _jspx_th_form_005fselect_005f1.setPageContext(_jspx_page_context);
                                            _jspx_th_form_005fselect_005f1
                                                    .setParent(_jspx_th_form_005fform_005f0);
                                            _jspx_th_form_005fselect_005f1.setPath("parentTable");
                                            _jspx_th_form_005fselect_005f1.setCssClass("form-control");
                                            int[] evalDoAfterBody = new int[1];

                                            try {
                                                int _jspx_exception1 = _jspx_th_form_005fselect_005f1
                                                        .doStartTag();
                                                int var125;
                                                if (_jspx_exception1 != 0) {
                                                    do {
                                                        ((JspWriter) out).write("\n");
                                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t\t");
                                                        OptionTag _jspx_th_form_005foption_005f0 = (OptionTag) this._005fjspx_005ftagPool_005fform_005foption_0026_005fvalue
                                                                .get(OptionTag.class);

                                                        try {
                                                            _jspx_th_form_005foption_005f0
                                                                    .setPageContext(_jspx_page_context);
                                                            _jspx_th_form_005foption_005f0
                                                                    .setParent(_jspx_th_form_005fselect_005f1);
                                                            _jspx_th_form_005foption_005f0.setValue("");
                                                            int[] evalDoAfterBody1 = new int[1];

                                                            try {
                                                                int _jspx_exception2 = _jspx_th_form_005foption_005f0
                                                                        .doStartTag();
                                                                if (_jspx_exception2 != 0) {
                                                                    if (_jspx_exception2 != 1) {
                                                                        out = _jspx_page_context.pushBody();
                                                                        ++evalDoAfterBody1[0];
                                                                        _jspx_th_form_005foption_005f0
                                                                                .setBodyContent(
                                                                                        (BodyContent) out);
                                                                        _jspx_th_form_005foption_005f0
                                                                                .doInitBody();
                                                                    }

                                                                    _jspx_page_context.findAttribute("value");
                                                                    String var124 = (String) _jspx_page_context
                                                                            .findAttribute("displayValue");

                                                                    int evalDoAfterBody2;
                                                                    do {
                                                                        ((JspWriter) out).write(26080);
                                                                        evalDoAfterBody2 = _jspx_th_form_005foption_005f0
                                                                                .doAfterBody();
                                                                        _jspx_page_context
                                                                                .findAttribute("value");
                                                                        var124 = (String) _jspx_page_context
                                                                                .findAttribute("displayValue");
                                                                    } while (evalDoAfterBody2 == 2);

                                                                    if (_jspx_exception2 != 1) {
                                                                        out = _jspx_page_context.popBody();
                                                                        --evalDoAfterBody1[0];
                                                                    }
                                                                }

                                                                if (_jspx_th_form_005foption_005f0
                                                                        .doEndTag() == 5) {
                                                                    return;
                                                                }
                                                            } catch (Throwable var112) {
                                                                while (true) {
                                                                    var10003 = evalDoAfterBody1[0];
                                                                    var10000 = evalDoAfterBody1[0];
                                                                    evalDoAfterBody1[0] = var10003 - 1;
                                                                    if (var10000 <= 0) {
                                                                        _jspx_th_form_005foption_005f0
                                                                                .doCatch(var112);
                                                                        break;
                                                                    }

                                                                    out = _jspx_page_context.popBody();
                                                                }
                                                            } finally {
                                                                _jspx_th_form_005foption_005f0.doFinally();
                                                            }
                                                        } finally {
                                                            this._005fjspx_005ftagPool_005fform_005foption_0026_005fvalue
                                                                    .reuse(_jspx_th_form_005foption_005f0);
                                                        }

                                                        ((JspWriter) out).write("\n");
                                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t\t");
                                                        if (this._jspx_meth_form_005foptions_005f1(
                                                                _jspx_th_form_005fselect_005f1,
                                                                _jspx_page_context, evalDoAfterBody)) {
                                                            return;
                                                        }

                                                        ((JspWriter) out).write("\n");
                                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                                        var125 = _jspx_th_form_005fselect_005f1.doAfterBody();
                                                    } while (var125 == 2);
                                                }

                                                if (_jspx_th_form_005fselect_005f1.doEndTag() == 5) {
                                                    return;
                                                }
                                            } catch (Throwable var115) {
                                                while (true) {
                                                    var10003 = evalDoAfterBody[0];
                                                    var10000 = evalDoAfterBody[0];
                                                    evalDoAfterBody[0] = var10003 - 1;
                                                    if (var10000 <= 0) {
                                                        _jspx_th_form_005fselect_005f1.doCatch(var115);
                                                        break;
                                                    }

                                                    out = _jspx_page_context.popBody();
                                                }
                                            } finally {
                                                _jspx_th_form_005fselect_005f1.doFinally();
                                            }
                                        } finally {
                                            this._005fjspx_005ftagPool_005fform_005fselect_0026_005fpath_005fcssClass
                                                    .reuse(_jspx_th_form_005fselect_005f1);
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t<td class=\"width-15 active\"><label class=\"pull-right\">?</label></td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<td class=\"width-35\">\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_form_005finput_005f3(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</td>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t</tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t</table>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t<button class=\"btn btn-white btn-sm\" onclick=\"return addColumn()\"><i class=\"fa fa-plus\"> </i></button>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t<button class=\"btn btn-white btn-sm\" onclick=\"return delColumn()\"><i class=\"fa fa-minus\"> </i> </button>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t<br/>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t<div class=\"tabs-container\">\n");
                                        ((JspWriter) out)
                                                .write("                    <ul class=\"nav nav-tabs\">\n");
                                        ((JspWriter) out).write(
                                                "                        <li class=\"active\"><a data-toggle=\"tab\" href=\"#tab-1\" aria-expanded=\"true\"> ?</a>\n");
                                        ((JspWriter) out).write("                        </li>\n");
                                        ((JspWriter) out).write(
                                                "                        <li class=\"\"><a data-toggle=\"tab\" href=\"#tab-2\" aria-expanded=\"false\">?</a>\n");
                                        ((JspWriter) out).write("                        </li>\n");
                                        ((JspWriter) out).write(
                                                "                        <li class=\"\"><a data-toggle=\"tab\" href=\"#tab-4\" aria-expanded=\"false\">?</a>\n");
                                        ((JspWriter) out).write("                        </li>\n");
                                        ((JspWriter) out).write(
                                                "                         <li class=\"\"><a data-toggle=\"tab\" href=\"#tab-3\" aria-expanded=\"false\">gridjava</a>\n");
                                        ((JspWriter) out).write("                        </li>\n");
                                        ((JspWriter) out).write("                         \n");
                                        ((JspWriter) out).write("                    </ul>\n");
                                        ((JspWriter) out)
                                                .write("                    <div class=\"tab-content\">\n");
                                        ((JspWriter) out).write(
                                                "                        <div id=\"tab-1\" class=\"tab-pane active\">\n");
                                        ((JspWriter) out).write(
                                                "                            <div class=\"panel-body\">\n");
                                        ((JspWriter) out).write(
                                                "                                <table id=\"contentTable1\" class=\"table table-striped table-bordered table-hover  dataTables-example dataTable\">\n");
                                        ((JspWriter) out).write("                                <thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out)
                                                .write("\t\t\t\t\t\t\t\t\t\t<th width=\"40px\">??</th>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t\t\t<th>?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<th title=\"???\">??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<th title=\"??\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<!-- <th title=\"?????\">?</th> -->\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<!--<th title=\"?insert?\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t\t\t<th title=\"?update?\"></th>  -->\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t</thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t<tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fif_005f0(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fforEach_005f4(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</table>\n");
                                        ((JspWriter) out).write("                            </div>\n");
                                        ((JspWriter) out).write("                        </div>\n");
                                        ((JspWriter) out).write(
                                                "                        <div id=\"tab-2\" class=\"tab-pane\">\n");
                                        ((JspWriter) out).write(
                                                "                            <div class=\"panel-body\">\n");
                                        ((JspWriter) out).write(
                                                "                                 <table id=\"contentTable2\" class=\"table table-striped table-bordered table-hover table-condensed dataTables-example dataTable\">\n");
                                        ((JspWriter) out).write("                              <thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"???\"  width=\"15%\">??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"\" width=\"15%\">Java</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??.??|??2|??3user.id|name|loginName??2??3Join?\">Java?? <i class=\"icon-question-sign\"></i></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\" width=\"15%\">??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\" width=\"15%\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?????\"></th>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fif_005f1(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fforEach_005f26(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</table>\n");
                                        ((JspWriter) out).write("                            </div>\n");
                                        ((JspWriter) out).write("                        </div>\n");
                                        ((JspWriter) out).write("                        \n");
                                        ((JspWriter) out).write(
                                                "                         <div id=\"tab-3\" class=\"tab-pane\">\n");
                                        ((JspWriter) out).write(
                                                "                            <div class=\"panel-body\">\n");
                                        ((JspWriter) out).write(
                                                "                                 <table id=\"contentTable3\" class=\"table table-striped table-bordered table-hover table-condensed dataTables-example dataTable\">\n");
                                        ((JspWriter) out).write("                              <thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"???\"  width=\"15%\">??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"\" width=\"15%\">table??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"label1|label2|label3??|??|\">JAVA<i class=\"icon-question-sign\"></i></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\">JAVA??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\">key</th>\n");
                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fif_005f5(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fforEach_005f30(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</table>\n");
                                        ((JspWriter) out).write("                            </div>\n");
                                        ((JspWriter) out).write("                        </div>\n");
                                        ((JspWriter) out).write("                        \n");
                                        ((JspWriter) out).write("                        \n");
                                        ((JspWriter) out).write(
                                                "                                <div id=\"tab-4\" class=\"tab-pane\">\n");
                                        ((JspWriter) out).write(
                                                "                            <div class=\"panel-body\">\n");
                                        ((JspWriter) out).write(
                                                "                                 <table id=\"contentTable4\" class=\"table table-striped table-bordered table-hover table-condensed dataTables-example dataTable\">\n");
                                        ((JspWriter) out).write("                              <thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tr>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"???\"  width=\"15%\">??</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"??\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?????\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"\"><i class=\"icon-question-sign\"></i></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"\"></th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"?\">?</th>\n");
                                        ((JspWriter) out).write(
                                                "\t\t\t\t\t\t\t\t<th title=\"\"></th>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tr>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</thead>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t<tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fif_005f6(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t\t");
                                        if (this._jspx_meth_c_005fforEach_005f38(_jspx_th_form_005fform_005f0,
                                                _jspx_page_context,
                                                _jspx_push_body_count_form_005fform_005f0)) {
                                            return;
                                        }

                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t\t</tbody>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\t</table>\n");
                                        ((JspWriter) out).write("                            </div>\n");
                                        ((JspWriter) out).write("                        </div>\n");
                                        ((JspWriter) out).write("                        \n");
                                        ((JspWriter) out).write("                    </div>\n");
                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("\n");
                                        ((JspWriter) out).write("                </div>\n");
                                        ((JspWriter) out).write("\t\t\t\t\t\n");
                                        ((JspWriter) out).write("\t\t\t");
                                        var123 = _jspx_th_form_005fform_005f0.doAfterBody();
                                    } while (var123 == 2);
                                }

                                if (_jspx_th_form_005fform_005f0.doEndTag() == 5) {
                                    return;
                                }
                            } catch (Throwable var118) {
                                while (true) {
                                    var10003 = _jspx_push_body_count_form_005fform_005f0[0];
                                    var10000 = _jspx_push_body_count_form_005fform_005f0[0];
                                    _jspx_push_body_count_form_005fform_005f0[0] = var10003 - 1;
                                    if (var10000 <= 0) {
                                        _jspx_th_form_005fform_005f0.doCatch(var118);
                                        break;
                                    }

                                    out = _jspx_page_context.popBody();
                                }
                            }
                        } finally {
                            _jspx_th_form_005fform_005f0.doFinally();
                        }
                    } finally {
                        this._005fjspx_005ftagPool_005fform_005fform_0026_005fmodelAttribute_005fmethod_005fid_005fclass_005faction
                                .reuse(_jspx_th_form_005fform_005f0);
                    }

                    ((JspWriter) out).write("\n");
                    ((JspWriter) out).write("\t\t\n");
                    ((JspWriter) out).write("\t</div>\n");
                    ((JspWriter) out).write("\t");
                }

                ((JspWriter) out).write("\n");
                ((JspWriter) out).write("\t\n");
                ((JspWriter) out).write("</body>\n");
                ((JspWriter) out).write("</html>\n");
            } catch (Throwable var121) {
                if (!(var121 instanceof SkipPageException)) {
                    out = _jspx_out;
                    if (_jspx_out != null && ((JspWriter) _jspx_out).getBufferSize() != 0) {
                        try {
                            if (response.isCommitted()) {
                                ((JspWriter) out).flush();
                            } else {
                                ((JspWriter) out).clearBuffer();
                            }
                        } catch (IOException var111) {
                            ;
                        }
                    }

                    if (_jspx_page_context == null) {
                        throw new ServletException(var121);
                    }

                    _jspx_page_context.handlePageException(var121);
                    return;
                }
            }

        } finally {
            _jspxFactory.releasePageContext(_jspx_page_context);
        }
    }
}