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

前端 未结 1 1226
梦如初夏
梦如初夏 2021-01-22 17:47

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

1条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-22 18:06

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

     -> 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:

     
       com.sun.faces.sendPoweredByHeader
       false
     
    

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

    0 讨论(0)
提交回复
热议问题