你的页面有吗?还有你的页面设置了限定吗?建议利用一个简单页面测试一下你的tomcat server如果没有问题的话,就检查你自己的页面吧!

解决方案 »

  1.   

    其实是一个servlet
    代码如下:
    /* ============================================================================
     * POP-Station Software
     * Copyright (c) 2004-, Modern Co., Ltd.  All rights reserved.
     * ============================================================================
     * ClassName: ReqInfoServlet
     *
     * Function : this servlet is order to switch and deal with request data
     *
     * History  :
     *
     *  2004/04/15  Xiqiang Yin: [PPST256]Create class
     * ============================================================================
     */
    package imo.popst.ris;import java.net.URL;
    import java.io.IOException;
    import java.sql.SQLException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpUtils;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;import java.util.*;import imo.popst.order.*;
    import imo.popst.cmn.*;
    import org.apache.log4j.Category;/**
     *
     * @author
     * @version 0.1
     */
    public class ReqInfoServlet extends HttpServlet {
      static Category log = Category.getInstance(ReqInfoServlet.class.getName());
      private String ET = "(enter)";  /**
       * init張棟
       */
      public void init(ServletConfig config) throws ServletException {
        super.init(config);
        String MN = "init";
        log.info(MN+ET);
      }  /**
       * HTTP Get 儕僋僄僗僩偺張棟
       */
      public void doGet(HttpServletRequest request, HttpServletResponse response)
                        throws ServletException, IOException {
        String MN = "doGet";
        log.info(MN+ET);    doPost( request, response );    log.info( MN+"/exit" );
      }  /**
       * HTTP Post 儕僋僄僗僩偺張棟
       */
      public void doPost(HttpServletRequest request, HttpServletResponse response)
                         throws ServletException, IOException {
        String MN = "doPost()";
        log.info(MN+ET);    Login login = Login.getLogin(request);
        if( login == null ) {
          String msg = "Login忣曬偑庢摼偱偒傑偣傫偱偟偨丅嵞儘僌僀儞偟偰偔偩偝偄丅";
          Msg.Disp( request, response, new MsgPack(MsgPack.FATAL,msg) );
          return;
        }
        ServletContext sc = getServletContext();
        String nextPage = "";
        HttpSession session = request.getSession(true);//    ActionModel am = new ActionModel();
        ActionModel am = null;
        am = (ActionModel)session.getAttribute("ConFigModel");
    //    System.out.println(MN+"model is "+am);
        if(am == null){
            log.error(MN+"ConfFigModel is null inside session");
            return;
        } nextPage = am.getParam1();
        log.debug(MN+" Action Type is:" + am.getType());
        
    if((am.getType()).equals("REQINFOLIST")){
    getReqInfoList(request,response,am);
        }
    else if ((am.getType()).equals ("REQINFOVIEW")){
    viewReqInfo(request);
        }
    else if ((am.getType()).equals ("REQINFOPAGE")){
            pagingReqInfo(request);
        }
        else if ((am.getType()).equals ("REQINFOLISTSORT")){
            nextPage = am.getParam1();
        }
        else if ((am.getType()).equals("REQINFOCREATE") ) {
    reqInfoCreate(request);
        }
        else if ((am.getType()).equals("REQINFOSAVEMODIFICATION")) {
    reqInfoSaveModification(request);
        }
        else if ((am.getType()).equals("NOASSOCIATEDREQUESTS")) {
    notAssoRequests(request);
        }
    else if ((am.getType()).equals("REQINFOSTATISTIC")) {
    statisticReqInfo(request);
        }
        else if ((am.getType()).equals("REQCONVERTTOORDER")) {
            convertReqToOrder(request);
        }
        else if ((am.getType()).equals("ASSOCIATEDORDERINFO")) {
    assoOrderInfo(request);
        }
        else if ((am.getType()).equals("CUTASSOCIATION") ) {
    cutAssociation(request);
        }
        else if ((am.getType()).equals("NOASSOCIATEDORDERS") ) {
    notAssoOrder(request);
        }
        else if ((am.getType()).equals("ASSOCIATEORDER")) {
    associateOrder(request);
        }
        else if ((am.getType()).equals ("REQINFOEDIT")) {//Edit certain Request.

    ReqInfoModel model = editReqInfo(request);
            ReqInfoDbacc reqDb = new ReqInfoDbacc ();
            if (reqDb.canBeEdited(model)) {
                nextPage = am.getParam1();
            }
            else {//need to redirect to note page
                log.error(MN+"/Error: The request can't be edited");
                return;
            }    }//if((am.getType()).equals ("REQINFOEDIT"))
        //Redirect to page
        log.info(MN+"ActionType is:" + am.getType() + ".\nAnd nextPage is:"+nextPage);
        if (nextPage == null) {
            nextPage = "";
        }
        if (nextPage.equals("")) {
            log.error(MN+"/Error: Can't get next step's page. Please check the configuration");
            return;
        }
        sc.getRequestDispatcher(nextPage).forward(request,response);
      }//doPost