com.opensymphony.xwork2.ActionSupport.shop1()报错

       Exception Name: java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.shop1()

一般有2中原因,1.是没指定action的路径 2.是action中没shop1()方法实现。

还有/shop/admin/shops!shop1.do中后的”!“非<result中name=“”属性名而是action中的shop1()方法.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
翻译代码:package com.action; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; import org.apache.struts2.ServletActionContext; import com.dao.TGonggaoDAO; import com.model.TAdmin; import com.model.TGonggao; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class gonggaoAction extends ActionSupport { private Integer id; private String biaoti; private String neirong; private String shijian; private String message; private String path; private TGonggaoDAO gonggaoDAO; public String gonggaoAdd() { TGonggao gonggao=new TGonggao(); gonggao.setBiaoti(biaoti); gonggao.setNeirong(neirong); gonggao.setShijian(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); gonggaoDAO.save(gonggao); this.setMessage("公告添加完毕"); this.setPath("gonggaoMana.action"); return "succeed"; } public String gonggaoMana() { List gonggaoList =gonggaoDAO.findAll(); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("gonggaoList", gonggaoList); return ActionSupport.SUCCESS; } public String gonggaoDel() { TGonggao gonggao=gonggaoDAO.findById(id); gonggaoDAO.delete(gonggao); this.setMessage("公告删除完毕"); this.setPath("gonggaoMana.action"); return "succeed"; } public String gonggaoDetailHou() { TGonggao gonggao=gonggaoDAO.findById(id); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("gonggao", gonggao); return ActionSupport.SUCCESS; } public String gonggaoAll() { List gonggaoList =gonggaoDAO.findAll(); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("gonggaoList", gonggaoList); return ActionSupport.SUCCESS; } public String gonggaoDetailQian() { TGonggao gonggao=gonggaoDAO.findById(id); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("gonggao", gonggao); return ActionSupport.SUCCESS; } public String getBiaoti() { return biaoti; } public void setBiaoti(String biaoti) { this.biaoti = biaoti; } public TGonggaoDAO getGonggaoDAO() { return gonggaoDAO; } public void setGonggaoDAO(TGonggaoDAO gonggaoDAO) { this.gonggaoDAO = gonggaoDAO; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getNeirong() { return neirong; } public void setNeirong(String neirong) { this.neirong = neirong; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getShijian() { return shijian; } public void setShijian(String shijian) { this.shijian = shijian; } }
最新发布
06-02

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值