1 7 package com.inversoft.verge.mvc.controller; 8 9 10 import java.net.URISyntaxException ; 11 12 import javax.servlet.http.HttpServletRequest ; 13 14 import com.inversoft.verge.util.url.URLGenerator; 15 import com.inversoft.verge.util.url.config.CategoryConfig; 16 17 18 27 public class GenericResult implements Result { 28 29 protected String url; 30 protected String category; 31 protected boolean forward; 32 33 34 37 protected GenericResult() { 38 } 39 40 44 public GenericResult(String url, String category) { 45 this.url = url; 46 this.category = category; 47 } 48 49 53 public GenericResult(String url, String category, boolean forward) { 54 this.url = url; 55 this.category = category; 56 this.forward = forward; 57 } 58 59 60 63 public String getURL() { 64 return url; 65 } 66 67 71 public boolean isForward() { 72 return forward; 73 } 74 75 78 public String getCategory() { 79 return category; 80 } 81 82 86 public String getGeneratedURL(HttpServletRequest request) 87 throws URISyntaxException { 88 String ret = null; 89 if (isForward()) { 90 ret = getURL(); 91 } else { 92 CategoryConfig cc = URLGenerator.getCategory(request, category); 93 ret = URLGenerator.generateURL(cc, url, true, request); 94 } 95 96 return ret; 97 } 98 } | Popular Tags |