1. 在jsp文件中
<s:form action=" savePlacardType">
<!--
savePlacardType 提交给去找struts.xml中的
<action name=" savePlacardType " class="savePlacardTypeAction">
<result name="success" type="redirect">jsp/base/placardType.jsp</result>
<result name="input">/placardTypeSave.jsp</result>
</action>
-->
<table>
<tr>
<td><s:textfield name=" pt .typeID" label="%{getText('typeID')}"></s:textfield></td>
</tr>
<tr>
--------------------上面的pt 和action中的get set后跟的名要一样. -----------------------
2. action文件
<s:form action=" savePlacardType">
<!--
savePlacardType 提交给去找struts.xml中的
<action name=" savePlacardType " class="savePlacardTypeAction">
<result name="success" type="redirect">jsp/base/placardType.jsp</result>
<result name="input">/placardTypeSave.jsp</result>
</action>
-->
<table>
<tr>
<td><s:textfield name=" pt .typeID" label="%{getText('typeID')}"></s:textfield></td>
</tr>
<tr>
--------------------上面的pt 和action中的get set后跟的名要一样. -----------------------
2. action文件
public class PlacardTypeSaveAction extends ActionSupport {
private PlacardTypeBean pt2; //这里的的写法是可以的。
private PlacardTypeService placardTypeService;
public PlacardTypeBean getPt() {
return pt2;
}
public void setPt(PlacardTypeBean pt3) {
this.pt2 = pt3;
}