📄 ordereventaction.java
字号:
/*
* 创建日期:2006-7-25 12:00:07
*
* 代码作者:Administrator
*
* 项目名称:eShop
*
* Copyright 2005 Metarnet, Inc. All right reserved.
*/
package eshop.business;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.text.*;
import java.util.*;
import java.math.*;
import eshop.common.*;
/**
* <h5>功能说明:</h5>
*
* <h5>对应需求:</h5>
*
*
* @version 1.0
* @author Administrator
*/
public class OrderEventAction extends HttpServlet
{
OrderVO aOrder=new OrderVO();
public void init() throws ServletException
{
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try
{
doProcess(request,response);
}
catch (ServletException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (IOException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (ParseException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (Exception e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try
{
doProcess(request,response);
}
catch (ServletException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (IOException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (ParseException e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
catch (Exception e)
{
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
public void destroy()
{
}
/**
* @param request
* @param response
* @throws ServletException
* @throws IOException
* @throws ParseException
* @throws Exception
*/
public void doProcess(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException,ParseException,Exception
{
doGetRecinfo(request,response);
HttpSession session=request.getSession();
session.setAttribute("ordervo",aOrder);
String strRedirectAddress="AuthorityAction?order.jsp";
response.sendRedirect(strRedirectAddress);
}
public void doGetRecinfo(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String strRealName=PublicBean.trans(request.getParameter("recname"));
String strAddress=PublicBean.trans(request.getParameter("recaddress"));
String strPostCode=request.getParameter("postcode");
String strEmail=request.getParameter("email");
String strTel=request.getParameter("tel");
String strPayMethod=PublicBean.trans(request.getParameter("paymethod"));
String strDeliverMethod=PublicBean.trans(request.getParameter("delivermethod"));
aOrder.setRecName(strRealName);
aOrder.setRecAddress(strAddress);
aOrder.setRecPostCode(strPostCode);
aOrder.setRecEmail(strEmail);
aOrder.setRecTel(strTel);
aOrder.setPayMethod(strPayMethod);
aOrder.setDeliverMethod(strDeliverMethod);
DateFormat orderDate_Formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
DateFormat orderID_Formatter = new SimpleDateFormat("yyyyMMddHHmmss");
String strOrderDate=orderDate_Formatter.format(new Date());
String strOrderID=orderID_Formatter.format(new Date());
aOrder.setOrderID(strOrderID);
aOrder.setOrderDate(strOrderDate);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -