如何在weblogic.xml中设置X-POWERED-BY? [英] How to set up X-POWERED-BY in weblogic.xml?

查看:1036
本文介绍了如何在weblogic.xml中设置X-POWERED-BY?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Here stated that it is possible to set X-POWERED-BY header appearance. But I don't see any way how to define this property through weblogic.xml. Anyone know how to do this?


通常,这些属性可以在集群级别被覆盖
(在ClusterMBean中,如果那里存在相同的属性),服务器
级别(在ServerMBean中,如果存在相同的属性)或者
特定的Web应用程序(在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

推荐答案

您应首先尝试通过管理控制台修改域名设置:

The first thing you should try is editing your domain setting through the admin console:

<domain name> -> Configuration -> Web Applications

更改 X-Powered-By标题:下拉到您需要的任何设置

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

For a specific application, like a servlet, you can also call this method:

HttpServletResponse setHeader()






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


If you need to remove it via your web.xml file, you can try:

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






如果你想用WLST设置它,试试:


If you want to set it using WLST try:

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

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

activate()

这篇关于如何在weblogic.xml中设置X-POWERED-BY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆