「struts2開発」getProxy().getNamespace()でnamespaceを取得する

struts.xml
<struts>
<package name=”cftUserInfo” namespace=”/foliofn”>
<action name=”loans” class=”tlc.ui.action.Loans” >
<result>/mainapp/pages/cftUserInfo/loans.jsp</result>
</action>
</package>

方法1
String namespace = ServletActionContext.getActionMapping().getNamespace();
方法2
String namespace = invocation.getProxy().getNamespace();

Comments are closed.