Commits

Anonymous committed c8acf6e

Comments (0)

Files changed (2)

src/java/com/opensymphony/webwork/views/jsp/vui/AbstractVUITag.java

         return BrowserSupport.getBrowserTemplateDirectory(ua);
     }
 
-    protected String constructURL(String value) {
-        // this was taken from URLTag
-        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
-        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
-        StringBuffer link = new StringBuffer();
-
-        if (value != null) {
-            // Check if context path needs to be added
-            // Add path to absolute links
-            if (value.startsWith("/")) {
-                link.append(request.getContextPath());
-            }
-
-            // Add page
-            link.append(value);
-        } else {
-            // Go to "same page"
-            String requestURI = (String) request.getAttribute("webwork.request_uri");
-
-            //         String contextPath=(String)request.getAttribute("webwork.context_path");
-            if (requestURI == null) {
-                requestURI = request.getRequestURI();
-            }
-
-            //         if(contextPath==null) contextPath=request.getContextPath();
-            link.append(requestURI);
-        }
-
-        String result;
-
-        try {
-            //Category.getInstance(this.getClass().getName()).debug(link.toString());
-            result = response.encodeURL(link.toString());
-        } catch (Exception e) {
-            // Could not encode URL for some reason
-            // Use it unchanged
-            result = link.toString();
-        }
-
-        return result;
-    }
-
     private void addParameterInternal(String name, Object value) {
         params.put(name, value);
     }

src/java/com/opensymphony/webwork/views/jsp/vui/FilledTag.java

 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import com.opensymphony.webwork.views.util.UrlHelper;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 
 /**
     }
 
     protected void initializeAttributes() {
-        String url = ((actionAttr != null) ? constructURL((String) findValue(actionAttr)) : null);
+        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
+
+        String url = ((actionAttr != null) ? UrlHelper.buildUrl((String) findValue(actionAttr), request, response, null) : null);
 
         if (url != null) {
             addParam("action", url);
-            url = ((actionaudioAttr != null) ? constructURL((String) findValue(actionaudioAttr)) : null);
+            url = ((actionaudioAttr != null) ? UrlHelper.buildUrl((String) findValue(actionaudioAttr), request, response, null) : null);
 
             if (url != null) {
                 addParam("actionaudio", url);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.