title: How to use spring security to prevent xss and xframe attack
body: <p>I look <a href="http://docs.spring.io/autorepo/docs/spring-security/3.2.0.CI-SNAPSHOT/reference/html/headers.html" rel="noreferrer">spring web site</a>  and want to prevent my website form xss and xframe attack</p>
  
  <p>But My english is not well enough to figure out what to set   </p>
  
  <p>Please guide me what else should I setting??   </p>
  
  <p>I just add a <code>WebSecurityConfig.java</code>  under <code>src/com/test/web/security</code></p>
  
  <p>Here is my code :  </p>
  
  <pre><code>package com.test.web.security;
  
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
  import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  
  @EnableWebSecurity
  @Configuration
  @ComponentScan
  public class WebSecurityConfig extends
  WebSecurityConfigurerAdapter {
  
  @Override
  protected void configure(HttpSecurity http) throws Exception {
   http
     // ...
     .headers();
  }
  }
  </code></pre>