1 5 package com.opensymphony.webwork.dispatcher; 6 7 import com.opensymphony.webwork.WebWorkStatics; 8 import com.opensymphony.xwork.ActionContext; 9 import com.opensymphony.xwork.ActionInvocation; 10 import com.opensymphony.xwork.Result; 11 import com.opensymphony.xwork.util.OgnlValueStack; 12 import com.opensymphony.xwork.util.TextParseUtil; 13 14 15 66 public abstract class WebWorkResultSupport implements Result, WebWorkStatics { 67 69 public static final String DEFAULT_PARAM = "location"; 70 71 73 protected boolean parse = true; 74 private String location; 75 76 78 86 public void setLocation(String location) { 87 this.location = location; 88 } 89 90 96 public void setParse(boolean parse) { 97 this.parse = parse; 98 } 99 100 108 public void execute(ActionInvocation invocation) throws Exception { 109 doExecute(conditionalParse(location, invocation), invocation); 110 } 111 112 protected String conditionalParse(String param, ActionInvocation invocation) { 113 if (parse && param != null && invocation != null) { 114 return TextParseUtil.translateVariables(param, invocation.getStack()); 115 } else { 116 return param; 117 } 118 } 119 120 129 protected abstract void doExecute(String finalLocation, ActionInvocation invocation) throws Exception ; 130 } 131 | Popular Tags |