http-headers - 如何在weblogic.xml中设置X-POWERED-BY?

标签 http-headers weblogic

这里声明可以设置 X-POWERED-BY header 外观。但我不知道如何通过 weblogic.xml 定义此属性。有人知道该怎么做吗?

In general, these properties can be overridden at the cluster level (in ClusterMBean, if the same property is present there), the server level (in ServerMBean, if the same property is present there) or for a specific Web application (in weblogic.xml)

http://docs.oracle.com/cd/E11035_01/wls100/wlsmbeanref/core/index.html

最佳答案

您应该尝试的第一件事是通过管理控制台编辑您的域设置:

<domain name> -> Configuration -> Web Applications

X-Powered-By Header: 下拉列表更改为 whatever setting you need .


对于特定的应用程序,例如 servlet,您还可以调用此方法:

HttpServletResponse setHeader()

如果您需要通过 web.xml 文件删除它,您可以尝试:

 <context-param>
   <param-name>com.sun.faces.sendPoweredByHeader</param-name>
   <param-value>false</param-value>
 </context-param>

如果您想使用 WLST 进行设置,请尝试:

connect(username, password, host_info)
edit()
cd("/WebAppContainer/" + domainName)
startEdit()

# set to NONE, SHORT, MEDIUM, or FULL
cmo.setXPoweredByHeaderLevel("NONE")

activate()

关于http-headers - 如何在weblogic.xml中设置X-POWERED-BY?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31875469/

相关文章:

ruby-on-rails - 在 Rails/Rack 中禁用 Content-Type header

Golang 错误的http请求头

java - 在应用服务器上部署多个应用程序(weblogic/websphere)

java - 使用 CXF JaxWSClientFactoryBean 创建 Web 服务客户端的 WSDL 解析异常

jakarta-ee - 可以在 Weblogic 中不同应用程序的 EJB 之间传播事务吗?

python - 如何告诉 HTTP 服务器不发送分块编码

javascript - 如何在 Apigee 中获取 HTTP header 的完整值?

javascript - PhantomJS 返回空主体

java - .jspx 中的编码错误

java - JDBC Pool 已挂起,无法为应用程序分配资源