用了titles框架,故多了一个titles的配置
jsp:
function onOk(e) {
$.ajax({
cache: true,
type: "POST",
url:"<%=path%>/productLabel/productLabelEdit!save.action",
data:$('#form1').serialize(),
async: false,
error: function (data) {
mini.alert(data.msg);
},
success: function(data) {
mini.alert(data.msg,'提示',function(){
CloseWindow("save");
});
}
});
}
struts:
<action name="productLabelEdit" class="productLabelAction">
<result type="tiles">/productLabel/productLabelEdit.tiles</result>
<result name="jsonMap" type="json">
<param name="root">jsonMap</param>
</result>
</action>
titles: <definition name="/productLabel/productLabelEdit.tiles" extends="contentLayout">
<put-attribute name="body" value="/jsp/product/productLabelEdit.jsp"/>
</definition>
action:
public String save() throws RollbackableException {
try {
String tagName = request.getParameter("tagName");
WelProductTag bean = new WelProductTag();
bean.setTagName(tagName);
bean.setTagDesc("1");
if (StringUtils.isNotBlank(tagName)) {
iProductLabelService.saveOrUpdate(bean);
jsonMap.put("success", true);
jsonMap.put("msg", "增加成功!");
OpeLog opeLog=new OpeLog();
//新增操作
opeLog.setOperType("insert");
//操作时间
opeLog.setOperDatetime(new Date());
//操作表
opeLog.setOperTableName("WEL_PRODUCT_TAG");
this.iLogService.insertLog(opeLog);
}else{
jsonMap.put("success", false);
jsonMap.put("msg", "增加失败,请稍后重试!");
}
} catch (Exception e) {
e.printStackTrace();
jsonMap.put("success", false);
jsonMap.put("msg", "保存失败,请稍后重试!");
}
return JSON_MAP;
}
1093

被折叠的 条评论
为什么被折叠?



