📄 retailmanager.java
字号:
package oracle.otnsamples.AQ.Manager;
/**
* @author Rajat Gupta
* @version 1.0
*
* Name of the Application : RetailManager.java
* Development Environment : Oracle 9i JDeveloper
* Creation/Modification History :
*
* Rajat Gupta 15-Jan-2001 Created
*
*/
// Servlet Imports
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
// Util Imports
import java.util.Vector;
// Other Files
import oracle.otnsamples.AQ.Helper.RetailHelper;
/**
* This class is invoked when the request comes from the Retail Admin.
* It has a method which displays all the orders made in this Shopping
* site. It also displays other related information about the order.
*
* @see Manager.java
*/
public class RetailManager implements Manager{
/**
* Empty Constructor
*/
public RetailManager(){
}
/**
* This is the main method which displays all the orders made by the customer.
* It gets the required attributes from the session and request objects and
* passes them to the helper classes.
*
* @param p_request HttpServlet Request Object
* @exception Exception In case an unreported exception is thrown
* @see RetailHelper.java
*/
public void displayOrders(HttpServletRequest p_request) throws Exception{
HttpSession session = p_request.getSession(false);
if (session == null){
throw new Exception("AQ-1018");
}
String user = (String)session.getAttribute("User");
Vector orders = RetailHelper.displayOrders(user);
p_request.setAttribute("Orders", orders);
return;
}
public void displayProduct(HttpServletRequest p_request) throws Exception{
HttpSession session = p_request.getSession(false);
if (session == null){
throw new Exception("AQ-1018");
}
String user = (String)session.getAttribute("User");
String orderID = p_request.getParameter("ShowProducts");
Vector products = RetailHelper.displayProduct(user, orderID);
p_request.setAttribute("Products", products);
return;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -