为什么会出现两个工程名
private void delete(HttpServletRequest request, HttpServletResponse response) throws IOException {
// 接受数据
Integer pid = Integer.parseInt(request.getParameter("pid"));
// 业务层
ProductService productService = new ProductServiceImpl();
// 查询商品
Product product = productService.findOne(pid);
String path = product.getPath();
if (path!= null && !"".equals(path)) {
// 获得磁盘绝对路径
String realPath = this.getServletContext().getRealPath(path);
File file = new File(realPath);
System.out.println(file.exists());
}
productService.delete(pid);
// 页面跳转
response.sendRedirect(request.getContextPath() + "/ProductServlet?method=findAll");
}
7
收起
正在回答 回答被采纳积分+1
2回答
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程


恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星