Java 我在哪里可以找到;j“安全检查”;?

Java 我在哪里可以找到;j“安全检查”;?,java,jsp,tomcat,servlets,Java,Jsp,Tomcat,Servlets,是否有“j_安全检查”的标准位置,以便我可以查看 对我的计算机的搜索没有找到该文件,只是引用了它。所以要么出于安全原因将其隐藏,要么它不是一个文件 我被锁定在应用程序之外,这是我第一次查看解决方案。这不是一个文件,这是基于容器身份验证的别名: 它是的一部分,内置于servletcontainer中。在您的情况下,它内置于Tomcat中。更具体地说,是类 这是/j\u安全检查 至于你被锁定的具体问题,只要确保你提供了正确的用户名和密码。用户数据库通常由配置。您不需要使用j_安全检查执行任何操作。问

是否有“j_安全检查”的标准位置,以便我可以查看

对我的计算机的搜索没有找到该文件,只是引用了它。所以要么出于安全原因将其隐藏,要么它不是一个文件


我被锁定在应用程序之外,这是我第一次查看解决方案。

这不是一个文件,这是基于容器身份验证的别名:

它是的一部分,内置于servletcontainer中。在您的情况下,它内置于Tomcat中。更具体地说,是类

这是
/j\u安全检查


至于你被锁定的具体问题,只要确保你提供了正确的用户名和密码。用户数据库通常由配置。

您不需要使用j_安全检查执行任何操作。问题在别处:

例如:

连接到数据库(如果使用tomcat,则连接到tomcat-users.xml文件)、密码加密、web.xml中的某些内容、context.xml中的某些内容。对于Glassfish,它也可以是池和域或Glassfish-web.xml中的某个内容

仔细检查日志。对于GF,您需要启用以下功能: (a) 转到此页:。(b) 将此属性设置为Finest:javax.enterprise.system.core.security

检查META-INF/context.xml,标记
227        // Is this the action request from the login page?
228        boolean loginAction =
229            requestURI.startsWith(contextPath) &&
230            requestURI.endsWith(Constants.FORM_ACTION);
231
232        // No -- Save this request and redirect to the form login page
233        if (!loginAction) {
234            session = request.getSessionInternal(true);
235            if (log.isDebugEnabled())
236                log.debug("Save request in session '" + session.getIdInternal() + "'");
237            try {
238                saveRequest(request, session);
239            } catch (IOException ioe) {
240                log.debug("Request body too big to save during authentication");
241                response.sendError(HttpServletResponse.SC_FORBIDDEN,
242                        sm.getString("authenticator.requestBodyTooBig"));
243                return (false);
244            }
245            forwardToLoginPage(request, response, config);
246            return (false);
247        }
248
249        // Yes -- Validate the specified credentials and redirect
250        // to the error page if they are not correct
251        Realm realm = context.getRealm();
252        if (characterEncoding != null) {
253            request.setCharacterEncoding(characterEncoding);
254        }
255        String username = request.getParameter(Constants.FORM_USERNAME);
256        String password = request.getParameter(Constants.FORM_PASSWORD);
257        if (log.isDebugEnabled())
258            log.debug("Authenticating username '" + username + "'");
259        principal = realm.authenticate(username, password);
260        if (principal == null) {
261            forwardToErrorPage(request, response, config);
262            return (false);
263        }