Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 服务器中未显示Tomcat登录表单_Java_Linux_Tomcat_Amazon Ec2_Jdbcrealm - Fatal编程技术网

Java 服务器中未显示Tomcat登录表单

Java 服务器中未显示Tomcat登录表单,java,linux,tomcat,amazon-ec2,jdbcrealm,Java,Linux,Tomcat,Amazon Ec2,Jdbcrealm,问题是:当我点击一个按钮时,假设“Tomcat领域安全”登录表单必须出现,因为受保护的资源被引用了,但没有发生。显示test.html页面的“xxx”内容 任何帮助都将不胜感激 可能并不重要,但:测试机器是带bitnami Tomcat灯的Windows,一切正常。目标框是预装Bitnami Tomcat灯的AWS Linux EC2(问题就在这里) 安装web应用程序的目录:ROOT(两台计算机) index.html文件包含对受保护资源的引用: <li><a href="/

问题是:当我点击一个按钮时,假设“Tomcat领域安全”登录表单必须出现,因为受保护的资源被引用了,但没有发生。显示test.html页面的“xxx”内容

任何帮助都将不胜感激

可能并不重要,但:测试机器是带bitnami Tomcat灯的Windows,一切正常。目标框是预装Bitnami Tomcat灯的AWS Linux EC2(问题就在这里)

安装web应用程序的目录:ROOT(两台计算机)

index.html文件包含对受保护资源的引用:

<li><a href="/test.html">Login</a></li>  
  • conf/server.xml配置了以下领域:

    <Realm className="org.apache.catalina.realm.LockOutRealm">  
        <!-- This Realm uses the UserDatabase configured in the global JNDI  
             resources under the key "UserDatabase".  Any edits  
             that are performed against this UserDatabase are immediately  
             available for use by the Realm.  -->  
      <!--  
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"  
               resourceName="UserDatabase"/>  
      -->  
                        <Realm  className="org.apache.catalina.realm.JDBCRealm"  
                                driverName="com.mysql.jdbc.Driver"  
                                connectionURL="jdbc:mysql://localhost:3306/dbName"  
                                        connectionName="dbUser"  
                                        connectionPassword="pass"  
                                        userTable="users"  
                                        userNameCol="user_name"  
                                        userCredCol="user_pass"  
                                        userRoleTable="users_roles"  
                                        roleNameCol="role_name"  
                                        digest="MD5"  
                        />  
      </Realm> 
    
    
    
    在表“users\u roles”中,有一个用户“test1”,分配了角色“user”

    WEB-INF/WEB.xml文件包含:

    <?xml version="1.0" encoding="UTF-8"?>  
        <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"xmlns="http://java.sun.com/xml/ns/javaee">  
        <welcome-file-list>  
        <welcome-file>index.html</welcome-file>  
        </welcome-file-list>  
    
        <!-- ************************************************************** -->  
        <!-- **************** Roles Declaration *************************** -->  
        <!-- ************************************************************** -->  
        <security-role>  
                <role-name>user</role-name>  
        </security-role>  
    
        <security-constraint>  
                <web-resource-collection>  
                        <web-resource-name>Wildcard means whole app requires authentication</web-resource-name>  
                        <url-pattern>/test.html</url-pattern>  
                        <http-method>GET</http-method>  
                        <http-method>POST</http-method>  
                </web-resource-collection>  
                <auth-constraint>  
                        <role-name>user</role-name>  
                </auth-constraint>  
                <user-data-constraint>  
                        <!-- transport-guarantee can be CONFIDENTIAL, INTEGRAL, or NONE -->  
                        <transport-guarantee>NONE</transport-guarantee>  
                </user-data-constraint>  
        </security-constraint>  
                <login-config>  
                <auth-method>FORM</auth-method>  
                <form-login-config>  
                        <form-login-page>/accounts/login.html</form-login-page>  
                        <form-error-page>/accounts/loginError.html</form-error-page>  
                </form-login-config>  
        </login-config>  
    
    
    index.html
    使用者
    通配符意味着整个应用程序需要身份验证
    /test.html
    收到
    邮递
    使用者
    没有一个
    类型
    /accounts/login.html
    /帐户/登录错误.html
    

    这里少了什么东西吗?可能是因为Linux机箱配置了Windows中没有的其他配置吗?(或者像往常一样,对用户是透明的)

    提前谢谢
    Omar

    它不会解决您看到的问题,但您应该从中删除HTTP方法,否则您只能保护这些方法。