1 /**
2 * Copyright By Grandsoft Company Limited.
3 * 2013-9-5 下午03:58:51
4 */
5 package gboat2.base.core.util;
6
7 import javax.servlet.http.HttpServletResponse;
8
9 import org.apache.struts2.ServletActionContext;
10
11 /**
12 *
13 * 在请求头部增加标识
14 * @author zhangxj-a
15 * @since jdk1.6
16 * @date 2013-9-5
17 *
18 */
19 public class HeaderUtil {
20
21 /**
22 * 如果请求失败,增加header头部标识
23 * @param success
24 */
25 public static void addHeaderResponseFailureA(boolean success){
26 HttpServletResponse response = ServletActionContext.getResponse();
27 if(!success){
28 response.addHeader("gboat2.failure", Boolean.FALSE.toString());
29 }
30 }
31
32 }