标签:EDA style ram eth pre value art attr alt
下架商品操作,将商品从数据库中删除。
dao层及其实现:
public void delete(String id); <delete id="delete"> delete from ec_article where id=#{id} </delete>
业务层及其实现::
//业务层
public void remove(String id ); //实现类中的方法 public void remove(String id) { articleDao.delete(id); }
servlet:
public void delete() throws ServletException, IOException { try{ String id=request.getParameter("id"); service1.remove(id); request.setAttribute("MSG","删除成功"); }catch (Exception e){ request.setAttribute("MSG","删除失败"); e.printStackTrace(); } request.getRequestDispatcher("/list?method=getAll").forward(request,response); }
前端的请求:
<a class="label label-danger" href="<c:url value="/list?method=deleteById&id=${a.id}&typeCode=${typeCode}&secondType=${secondType}&title=${title}"/>">删除</a>
问:
标签:EDA style ram eth pre value art attr alt
原文地址:https://www.cnblogs.com/liu-chen/p/11741870.html