我在struts.xml中有一个名称空间
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.DayOfMonth)
</td>
<td>
@Html.DisplayFor(modelItem => item.TimeSpent) hr
</td>
<td>
@Html.DisplayFor(modelItem => item.Project.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Task.Name)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.IdTimeSheet_Details }) |
@Html.ActionLink("Details", "Details", new { id = item.IdTimeSheet_Details }) |
@Html.ActionLink("Delete", "Delete", new { id = item.IdTimeSheet_Details })
</td>
</tr>
}
我想将@Html.DisplayFor(modelItem => item.DayOfMonth, "{0:MM/dd/yyyy}")
@Html.DisplayFor(modelItem => item.DayOfMonth.Date.ToString("dd MMM yyyy"))
@Html.DisplayFor(modelItem => item.DayOfMonth.Value.ToString("dd. MM. yyyy"))
@Html.DisplayFor(modelItem => item.DayOfMonth.ToShortDateString() : string.Empty))
@Html.DisplayFor(modelItem => item.DayOfMonth.ToString("dd MMM yyyy"))
@Html.DisplayFor(modelItem => item.DayOfMonth.Value.ToString("dd - M - yy"))
映射到<package name="mobile" namespace="/mobile" extends="mainApp">
<action name="abc" class="x.y.Abc"
method="abc">
<result name="input">/blank.html</result>
<result name="success">/blank.html</result>
</action>
</package>
我不介意将localhost/myApp/mobile/
映射到动作abc
有没有办法满足这个要求?
答案 0 :(得分:1)
我想在localhost上触发一个动作:8080 / appname / namespace / ie namespace slash
斜杠后应该是动作名称,如果它是空的,你应该配置空动作名称。
<package name="mobile" namespace="/mobile" extends="mainApp">
<action name="" class="x.y.Abc"
method="abc">
<result name="input">/blank.html</result>
<result name="success">/blank.html</result>
</action>
</package>
答案 1 :(得分:0)
尝试<default-action-ref/>
:
<package name="mobile" namespace="/mobile" extends="mainApp">
<default-action-ref name="abc"/> <!-- I added this -->
<action name="abc" class="x.y.Abc"
method="abc">
<result name="input">/blank.html</result>
<result name="success">/blank.html</result>
</action>
</package>