public String getUriFromActionMapping(ActionMapping mapping) { String base = mapping.getNamespace() + mapping.getName(); for (Iterator iterator = mapping.getParams().entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); if (name.equals(mapping.getName() + "Id")) { base = base + "/" + entry.getValue(); break; } } return base; } }
public String getUriFromActionMapping(ActionMapping mapping) { StringBuffer uri = new StringBuffer(); uri.append(mapping.getNamespace()); if(!"/".equals(mapping.getNamespace())) { uri.append("/"); } String name = mapping.getName(); String params = ""; if ( name.indexOf('?') != -1) { params = name.substring(name.indexOf('?')); name = name.substring(0, name.indexOf('?')); } uri.append(name); if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) { uri.append("!").append(mapping.getMethod()); } String extension = getDefaultExtension(); if ( extension != null && uri.indexOf( '.' + extension) == -1 ) { uri.append(".").append(extension); if ( params.length() > 0) { uri.append(params); } } return uri.toString(); }
String namespace = ActionMapperFactory.getMapper().getMapping(request).getNamespace();
public static String buildNamespace(OgnlValueStack stack, HttpServletRequest request) { ActionContext context = new ActionContext(stack.getContext()); ActionInvocation invocation = context.getActionInvocation(); if (invocation == null) { ActionMapper mapper = ActionMapperFactory.getMapper(); ActionMapping mapping = mapper.getMapping(request); if (mapping != null) { return mapping.getNamespace(); } else { // well, if the ActionMapper can't tell us, and there is no existing action invocation, // let's just go with a default guess that the namespace is the last the path minus the // last part (/foo/bar/baz.xyz -> /foo/bar) String path = RequestUtils.getServletPath(request); return path.substring(0, path.lastIndexOf("/")); } } else { return invocation.getProxy().getNamespace(); } } }
String namespace = mapping.getNamespace(); String name = mapping.getName(); String method = mapping.getMethod();
PortletMode mode = request.getPortletMode(); String actionName = mapping.getName(); String namespace = mapping.getNamespace(); try { LOG.debug("Creating action proxy for name = " + actionName