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

📄 overridepage.java

📁 这是一个java编写的程序
💻 JAVA
字号:
/** * Example Mapper Application * by: Marty Phelan * * This example is free software; you can redistribute it and/or * modify it as you wish.  It is released to the public domain. * * This example is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */package com.taursys.examples.simpleweb;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.taursys.servlet.ServletForm;/** @todo (this example is under construction) *//** * OverridePage demonstrates how to override most of the ServletApp methods. */public class OverridePage extends ServletForm {  /**   * Constructs a new OverridePage and initializes component properties.   */  public OverridePage() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**   * Set component properties here.  It is not recommended to put anything   * other than property settings in here.  Any Exception will cause the   * constructor to fail.   */  private void jbInit() throws Exception {    this.setDocumentURI("resource:///forms/OverridePage.html");  }  /**   * This method is invoked by the application servlet to service the GET request.   * This method invokes a series of other support methods in a specific sequence:   * <ul>   * <li>saves request and response in public properties</li>   * <li>initForm (only invoked if isInitialized is false)</li>   * <li>dispatchParameters</li>   * <li>openForm</li>   * <li>dispatchInput</li>   * <li>dispatchActions</li>   * <li>sendResponse</li>   * </ul>   * If an exception is generated by any of these methods, the handleException   * method is invoked. It can either handle the exception and send the   * response, or it can rethrow the exception and let the application servlet   * handle it (latter is default behavior).   */  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws Exception {    try {      setRequest(req);      setResponse(resp);      if (!isInitialized())        initForm();      setParameterMap(createParameterMap());      // dispatch initialization to nested forms      dispatchInitContext();      dispatchInitForm();      // Begin processing      dispatchParameters();      openForm();      dispatchOpenForm();      if (isEnableInput()) {        dispatchInput();      }      if (isEnableActions()) {        dispatchActions();      }      sendResponse();    } catch (Exception ex) {      handleException(ex);    } finally {      dispatchCloseForm();      closeForm();    }  }  /**   * One time initialization of the ServletForm.  This method is invoked ONCE.   * It is the first method invoked by the doGet method.  If the form is   * recycled, it will NOT be invoked again by doGet.   */  protected void initForm() throws java.lang.Exception {    super.initForm();  }  /**   * This method is invoked by doGet to open the form.   * It is invoked after any parameters have been read, but before input   * values have been read.  Override this method to provide custom   * behavior such as opening data sources.  There is no need to invoke   * super.openForm().   */  protected void openForm() throws java.lang.Exception {  }  /**   * Send the appropriate response. It is invoked by doGet following the   * dispatchActions method.  This method invokes the current Responder's   * respond method to provide the appropriate response.   * Change the Responder to provide custom response.   */  protected void sendResponse() throws java.lang.Exception {    super.sendResponse();  }  /**   * Closes the form and any resources it may have opened.  This method is   * the final method invoked by the doGet method (even if an Exception   * occurred).  The method currently does nothing, so there is no need to   * invoke super.closeForm().   */  protected void closeForm() throws java.lang.Exception {  }  /**   * This method is invoked whenever an exception occurs within doGet.   * Override this method to provide custom exception handling behavior.   * Throwing an exception will delegate the exception handling to the   * caller of the doGet method.   * The default behavior of this method is to simply re-throw the exception.   */  protected void handleException(Exception ex) throws java.lang.Exception {    throw ex;  }  /**   * Returns true to indicate that this form can be re-used.   * If the form cannot be reused, override this method and return false.   * Override this method to provide custom behavior to recycle this form   * for future re-use.  This is invoked by the ServletFormFactory before   * the form is added to the pool of available forms.   */  public boolean recycle() {    return super.recycle();  }}

⌨️ 快捷键说明

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