Lyn*_*ynn 3 java freemarker struts2
例如http://localhost/market/pcsuite/edit.action
我可以在freemarker文件edit.flt中获取操作名称"edit"吗?
<@s.property value="com.opensymphony.xwork2.ActionContext.name" />
Run Code Online (Sandbox Code Playgroud)
要么
<@s.set var="actionName" value="com.opensymphony.xwork2.ActionContext.name" />
<#-- Use as -->
<@s.property value="actionName" />
<#-- Or other FreeMarker Tags -->
Run Code Online (Sandbox Code Playgroud)
要么
在中创建一个getter action class
,例如
public String getActionName() {
return ActionContext.getContext().getName();
}
Run Code Online (Sandbox Code Playgroud)
<@s.property value="actionName" />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3296 次 |
最近记录: |