struts得到当前访问路径的namespace及action

读struts2源码org.apache.struts2.components.ServletUrlRenderer得到当前访问路径的namespace及action。

 ActionInvocation ai = (ActionInvocation) ActionContext.getContext().get(ActionContext.ACTION_INVOCATION);
			 final String action = ai.getProxy().getActionName();
             final String namespace = ai.getProxy().getNamespace();
             System.out.println(action+"--------"+namespace);

 

你可能感兴趣的:(apache,struts)