简体   繁体   中英

How do I set X-FRAME-OPTIONS in JBoss EAP 6.1?

I am running a java spring application on Jboss EAP 6.1 X-FRAME-OPTIONS in the request header when performing a file upload is DENY and I receive the following errors. The file upload also does not appear on the page.

iframe错误

All of the solutions I see online say that I should try setting this value to SAMEORIGIN. They also show how to configure this in Apache but does anyone know how I set this option for Jboss?

Ok the other way is to create a HTTP filter.

Create a class that implements javax.servlet.Filter Annotate the class with @WebFilter("/*") or the context you need.

In the doFilter method set the HTTP header you need and do not forget to call chain.doFilter(request, response); afterwards.

Build this class into a JAR and make sure it is placed in your WEB-INF/lib directory.

See the answer to this question system-properties In standalone-full.xml

In your standalone XML you can set the Apache Catalina properties like this:

   <system-properties>
        <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="5000"/>
    </system-properties>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM