Java HTTPS在Netbeans中不起作用
我正在中创建一个web应用程序,并将其用作web服务器。当我为我的应用程序创建war文件时,在Java HTTPS在Netbeans中不起作用,java,tomcat,netbeans,https,ssl-certificate,Java,Tomcat,Netbeans,Https,Ssl Certificate,我正在中创建一个web应用程序,并将其用作web服务器。当我为我的应用程序创建war文件时,在Tomcat外部Netbeans中部署,然后运行应用程序,应用程序工作。但当我从Netbeans运行应用程序时,Netbeans自动重定向到https,浏览器显示此网页不可用。我使用为我的应用程序创建了证书 我的web.xml如下所示: <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="ht
Tomcat
外部Netbeans
中部署,然后运行应用程序,应用程序工作。但当我从Netbeans
运行应用程序时,Netbeans
自动重定向到https
,浏览器显示此网页不可用。我使用为我的应用程序创建了证书
我的web.xml
如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" 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_3_0.xsd">
<servlet>
<servlet-name>readCert</servlet-name>
<servlet-class>readCert</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>readCert</servlet-name>
<url-pattern>/readCert</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>This app requires authentication</web-resource-name>
<url-pattern>/</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>tomcat</role-name>
</auth-constraint>
<user-data-constraint>
<!-- transport-guarantee can be CONFIDENTIAL, INTEGRAL, or NONE -->
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>CLIENT-CERT</auth-method>
</login-config>
</web-app>
<Connector
protocol="org.apache.coyote.http11.Http11Protocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="D:\misCert.crt" keystorePass="123456"
clientAuth="false" sslProtocol="TLS"/>
如何解决此问题?NetBeans启动应用程序后,浏览器中会出现什么URL?谢谢您的评论。当我从Netbeans运行应用程序时,它会自动重定向到。MIS是我的应用程序名在您的OP中,您说过该应用程序名为MyAppName
。在任何情况下,您都应该发布您的web.xml文件,这可能会立即解释这里出现的问题。好的,我将更改并添加整个web.xml当您说它在Tomcat外部运行时,您的意思是什么?你看到了哪一页?