/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package action;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import domain.Product;
import service.ProductService;
import service.ServiceFactory;
/**
* MyEclipse Struts Creation date: 02-02-2010
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class ProductClass extends DispatchAction {
/*
* Generated Methods
*/
ProductService productService = ServiceFactory.getProductService();
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward queryProduct(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String name= request.getParameter("name");
List list = productService.queryProduct(name);
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("ProductListView");
}
public ActionForward catong(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.catong();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("/productList.do");
}
public ActionForward human(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.human();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("/productList.do");
}
public ActionForward flower(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.flower();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("/productList.do");
}
public ActionForward animal(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.animal();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("/productList.do");
}
public ActionForward senery(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.senery();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("/productList.do");
}
public ActionForward catong1(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.catong();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product) it.next();
ServletContext ctx = this.getServlet().getServletContext();
String fileName = ctx.getRealPath("res" + "/" + product.getId()
+ ".jpg");
File file = new File(fileName);
if (!file.exists()) {
InputStream is = product.getPic().getBinaryStream();
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));
int b = -1;
while ((b = is.read()) != -1) {
bos.write(b);
}
bos.close();
is.close();
}
}
request.setAttribute("productList", list);
return new ActionForward("ProductListView");
}
public ActionForward human1(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
List list = productService.human();
Iterator it = list.iterator();
while (it.hasNext()) {
Product product = (Product
没有合适的资源?快使用搜索试试~ 我知道了~
基于java的电子商务系统(Struts+Spring+Hibernate)+MySQL
共172个文件
java:45个
class:45个
jsp:26个
4星 · 超过85%的资源 需积分: 10 21 下载量 91 浏览量
2011-05-25
11:55:19
上传
评论 3
收藏 2.23MB RAR 举报
温馨提示
网上商店系统所要实现的功能如下: 1. 有关用户的功能(前台) (1) 用户的注册,包括验证用户注册的信息。 (2) 用户登录的身份验证。 (3) 修改用户信息。 (4) 在不同页面浏览时判断用户身份的权限。 2. 销售系统的要求(前台) (1) 用户浏览所有的商品。 (2) 用户可按商品类别进行查找商品。 (3) 用户可购买自己需要的商品。 (4) 用户可对购物车进行管理。 (5) 提交订单。 (6) 用户能够查找自己的订单。
资源推荐
资源详情
资源评论
收起资源包目录
基于java的电子商务系统(Struts+Spring+Hibernate)+MySQL (172个子文件)
ProductClass.class 8KB
ProductServiceImpl.class 5KB
CreateProductAction.class 4KB
CartServiceImpl.class 3KB
ListProductAction.class 3KB
HomeAction.class 3KB
BackProductList.class 3KB
OrderServiceImpl.class 3KB
AccountServiceImpl.class 2KB
AddLineItemAction.class 2KB
BackLogin.class 2KB
LoginAction.class 2KB
Account.class 2KB
AccountForm.class 2KB
ListOrderAction.class 2KB
NewProduct.class 2KB
AlterCartAction.class 2KB
Product.class 2KB
CreateOrderAction.class 2KB
BackStageServiceImpl.class 2KB
ShowCartAction.class 2KB
Test1.class 2KB
UpdateForm.class 2KB
AddAdminAction.class 2KB
ValidateUsernameAction.class 2KB
LineItem.class 2KB
Test.class 2KB
Order.class 2KB
UpdateProduct.class 2KB
SomeServlet.class 1KB
CreateAccountAction.class 1KB
Item.class 1KB
DeleteProduct.class 1KB
AdminForm.class 1KB
MyFilter.class 1KB
LogoutAction.class 1KB
Admin.class 1KB
ServiceFactory.class 1KB
EncryptUtil.class 1KB
HibernateSessionFactory.class 917B
ProductService.class 735B
CartService.class 403B
OrderService.class 335B
AccountService.class 313B
BackStageService.class 218B
.classpath 1KB
style.css 9KB
login.css 640B
Thumbs.db 20KB
head.gif 194KB
nane.gif 12KB
tableheader-bg.gif 3KB
footer.gif 2KB
tableheader-bg-grey.gif 1KB
bg.gif 446B
footer_bg.gif 439B
top_left.gif 258B
bullet_green.gif 182B
content_bg.gif 143B
bullet_grey.gif 128B
button.gif 104B
mysql-connector-java-5.1.5-bin.jar 661KB
struts.jar 474KB
antlr.jar 344KB
log4j-1.2.13.jar 312KB
commons-beanutils.jar 160KB
commons-digester.jar 147KB
commons-validator.jar 74KB
jakarta-oro.jar 62KB
commons-logging.jar 33KB
commons-fileupload.jar 19KB
jspSmartUpload.jar 12KB
ProductClass.java 11KB
ProductServiceImpl.java 4KB
CreateProductAction.java 3KB
BackLogin.java 3KB
HomeAction.java 3KB
BackProductList.java 2KB
CartServiceImpl.java 2KB
Test1.java 2KB
ListProductAction.java 2KB
OrderServiceImpl.java 2KB
NewProduct.java 2KB
Account.java 2KB
UpdateProduct.java 2KB
AddAdminAction.java 1KB
AccountServiceImpl.java 1KB
UpdateForm.java 1KB
AccountForm.java 1KB
Product.java 1KB
AddLineItemAction.java 1KB
LoginAction.java 1KB
ListOrderAction.java 1KB
AdminForm.java 1KB
Test.java 1KB
DeleteProduct.java 1KB
CreateOrderAction.java 1KB
AlterCartAction.java 1KB
LineItem.java 1KB
LogoutAction.java 1KB
共 172 条
- 1
- 2
资源评论
- a11734684062016-05-24得费心思去调试一下,不能直接运行。还是比较练手的。
xx1215
- 粉丝: 5
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功