⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getbids.java

📁 J2EE开发与Weblogic一书中的源代码
💻 JAVA
字号:
package webauction.web.action;

import java.io.IOException;
import java.rmi.RemoteException;
import javax.servlet.*;
import javax.servlet.http.*;
import webauction.ejb.*;
import webauction.web.WebConstants;
import webauction.web.javabean.*;

public class GetBids extends HttpServlet {

    public void service(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {
        ServletContext sc = getServletContext();
        WebAuction webAuction =
            (WebAuction) sc.getAttribute(WebConstants.SC_ATTRIB_WEBAUCTION);
        try {
            BidValueHolder[] bids =
                webAuction.getBidsForUser(req.getRemoteUser());
            BidsListBean bidsBean = new BidsListBean();
            bidsBean.setBids(bids);
            bidsBean.setUserName(req.getRemoteUser());
            req.setAttribute("bids", bidsBean);

            PageBean pageBean = new PageBean();
            pageBean.setTitle("WebLogic Auction");
            pageBean.setBody("jsp/listbids.jsp");
            req.setAttribute("pageBean", pageBean);
        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (NoSuchUserException e) {
            e.printStackTrace();
        }

        RequestDispatcher rd = sc.getNamedDispatcher("template");
        rd.forward(req, res);
        return;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -