How to set up X-POWERED-BY in weblogic.xml?

☆樱花仙子☆ 提交于 2019-12-04 04:53:44

问题


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?

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


回答1:


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

<domain name> -> Configuration -> Web Applications

Change the X-Powered-By Header: drop down to whatever setting you need.


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

HttpServletResponse setHeader()

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>

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()


来源:https://stackoverflow.com/questions/31875469/how-to-set-up-x-powered-by-in-weblogic-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!