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

📄 ex6_17.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 6.17 Request Context Map Strategy
public class FrontController extends HttpServlet {
. . .
  private void processRequest(HttpServletRequest request, 
      HttpServletResponse response) throws ServletException,
          java.io.IOException {

    // create RequestContext object using Map Strategy
    Map requestContextMap = new HashMap(request.getParameterMap());
    Dispatcher dispatcher = new Dispatcher(request, response);
    requestContextMap.put("dispatcher", dispatcher);

    // Create ApplicationController instance
    ApplicationController applicationController = 
        new ApplicationControllerImpl();

    // Request processing
    ResponseContext responseContext =
        applicationController.handleRequest(requestContextMap);

    // Response processing
    applicationController.handleResponse(requestContextMap,
        responseContext);
  }
  . . .
}

⌨️ 快捷键说明

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