Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.tectonica.util;
 
 
 public class ServletUtil
 {
 	public static void applyCORS(HttpServletRequest reqHttpServletResponse resp)
 	{
		resp.setHeader("Access-Control-Allow-Origin""*");
		resp.setHeader("Access-Control-Allow-Methods""GET, POST, OPTIONS");
		String acrh = req.getHeader("Access-Control-Request-Headers");
		if (acrh != null && !acrh.isEmpty())
			resp.setHeader("Access-Control-Allow-Headers"acrh);
	}
New to GrepCode? Check out our FAQ X