fork download
  1. package com.ezaurum.study;
  2.  
  3. import java.io.IOException;
  4.  
  5. import javax.servlet.FilterChain;
  6. import javax.servlet.ServletException;
  7. import javax.servlet.http.HttpServletRequest;
  8. import javax.servlet.http.HttpServletResponse;
  9.  
  10. import org.springframework.web.filter.OncePerRequestFilter;
  11.  
  12. public class ThirdPartyCookieAcceptFilter extends OncePerRequestFilter {
  13.  
  14. @Override
  15. protected void doFilterInternal(HttpServletRequest request,
  16. HttpServletResponse response, FilterChain filterChain)
  17. throws ServletException, IOException {
  18. response.addHeader("P3P","CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'");
  19.  
  20. filterChain.doFilter(request, response);
  21. }
  22.  
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: class ThirdPartyCookieAcceptFilter is public, should be declared in a file named ThirdPartyCookieAcceptFilter.java
public class ThirdPartyCookieAcceptFilter  extends OncePerRequestFilter  {
       ^
Main.java:5: package javax.servlet does not exist
import javax.servlet.FilterChain;
                    ^
Main.java:6: package javax.servlet does not exist
import javax.servlet.ServletException;
                    ^
Main.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
                         ^
Main.java:8: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
                         ^
Main.java:10: package org.springframework.web.filter does not exist
import org.springframework.web.filter.OncePerRequestFilter;
                                     ^
Main.java:12: cannot find symbol
symbol: class OncePerRequestFilter
public class ThirdPartyCookieAcceptFilter  extends OncePerRequestFilter  {
                                                   ^
Main.java:15: cannot find symbol
symbol  : class HttpServletRequest
location: class com.ezaurum.study.ThirdPartyCookieAcceptFilter
	protected void doFilterInternal(HttpServletRequest request,
	                                ^
Main.java:16: cannot find symbol
symbol  : class HttpServletResponse
location: class com.ezaurum.study.ThirdPartyCookieAcceptFilter
			HttpServletResponse response, FilterChain filterChain)
			^
Main.java:16: cannot find symbol
symbol  : class FilterChain
location: class com.ezaurum.study.ThirdPartyCookieAcceptFilter
			HttpServletResponse response, FilterChain filterChain)
			                              ^
Main.java:17: cannot find symbol
symbol  : class ServletException
location: class com.ezaurum.study.ThirdPartyCookieAcceptFilter
			throws ServletException, IOException {
			       ^
Main.java:14: method does not override or implement a method from a supertype
	@Override
	^
12 errors
stdout
Standard output is empty