web.xml里加入
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>TRACE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
server.xml里加入
<Connector
port="443"
maxHttpHeaderSize="8192"
maxThreads="1000"
minSpareThreads="50"
maxSpareThreads="70"
enableLookups="true"
disableUploadTimeout="true"
acceptCount="100"
scheme="https"
secure="true"
clientAuth="false"
sslProtocol="TLS"
keystoreFile="*.keystore"
keystorePass="***"/>
由https到http,正好相反。
本文介绍如何通过修改web.xml和server.xml文件配置应用以支持HTTPS安全访问。具体包括定义受保护的资源集合、设置数据传输保障级别及配置SSL连接器。
1648

被折叠的 条评论
为什么被折叠?



