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

📄 ex6_19.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 6.19 ApplicationControllerImpl
public class ApplicationControllerImpl implements 
    ApplicationController {

  public void initialize() {
    commandMapper = CommandMapper.getInstance();
  }

  public ResponseContext handleRequest(RequestContext requestContext) {
    ResponseContext responseContext = null;
    try {
      // validate request parameters
      requestContext.validate();

      // Translate command name into Command abstraction
      String commandName = requestContext.getCommandName();
      Command command = commandMapper.getCommand(commandName);

      // Invoke Command
      responseContext = command.execute(requestContext);

      // Identify View Name
      CommandMap  mapEntry = commandMapper.getCommandMap(commandName);
      String viewName = mapEntry.getViewName();
      responseContext.setLogicalViewName(viewName);
    } catch (ValidatorException e1) {
      // Handle Exception
    }
    return responseContext;
  }
. . .

⌨️ 快捷键说明

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