String xgsj=request.getParameter("xgsj");得不到值为什么?

解决方案 »

  1.   

    private ServletConfig config;
      private String[] fileName;  final public void init(ServletConfig config) throws ServletException {
        this.config = config;
      }
      final public ServletConfig getServletConfig() {
        return config;
      }
          SmartUpload mySmartUpload=new SmartUpload();
          // Initialization
          mySmartUpload.initialize(config,request,response);      
    String operation=mySmartUpload.getRequest().getParameter("operation").trim();
      

  2.   

    mySmartUpload.initialize(pageContext);与mySmartUpload.initialize(config,request,response);关系?
      

  3.   

    希望你能看明白::)m_requtest: HttpServletRequest
    m_formRequest: 
            int m_totalBytes = m_request.getContentLength();
            Byte[] m_binArray = new byte[m_totalBytes];
            int j;
            for(; i < m_totalBytes; i += j)
                try
                {
                    m_request.getInputStream();
                    j = m_request.getInputStream().read(m_binArray, i, m_totalBytes - i);
                }
                catch(Exception exception)
                {
                }        for(; !flag1 && m_currentIndex < m_totalBytes; m_currentIndex++)
                if(m_binArray[m_currentIndex] == 13)
                    flag1 = true;
                else
                    m_boundary = m_boundary + (char)m_binArray[m_currentIndex];        if(m_currentIndex == 1)
                return;
            for(m_currentIndex++; m_currentIndex < m_totalBytes; m_currentIndex = m_currentIndex + 2)
            {
                String s1 = getDataHeader();
                m_currentIndex = m_currentIndex + 2;
                boolean flag3 = s1.indexOf("filename") > 0;
                String s3 = getDataFieldValue(s1, "name");
                 getDataSection();
                 String s11 = new String(m_binArray, m_startData, (m_endData - m_startData) + 1);
                    putParameter(s3, s11);
                if((char)m_binArray[m_currentIndex + 1] == '-')
                    break;
            }private void getDataSection()
        {
            boolean flag = false;
            String s = new String();
            int i = m_currentIndex;
            int j = 0;
            int k = m_boundary.length();
            m_startData = m_currentIndex;
            m_endData = 0;
            while(i < m_totalBytes) 
                if(m_binArray[i] == (byte)m_boundary.charAt(j))
                {
                    if(j == k - 1)
                    {
                        m_endData = ((i - k) + 1) - 3;
                        break;
                    }
                    i++;
                    j++;
                } else
                {
                    i++;
                    j = 0;
                }
            m_currentIndex = m_endData + k + 3;
        }
    protected void putParameter(String s, String s1)
        {
            Hashtable m_parameters = new Hashtable();
            int m_counter = 0;
            if(s == null)
                throw new IllegalArgumentException("The name of an element cannot be null.");
            if(m_parameters.containsKey(s))
            {
                Hashtable hashtable = (Hashtable)m_parameters.get(s);
                hashtable.put(new Integer(hashtable.size()), s1);
            } else
            {
                Hashtable hashtable1 = new Hashtable();
                hashtable1.put(new Integer(0), s1);
                m_parameters.put(s, hashtable1);
                m_counter++;
            }
        }
      

  4.   

    // Initialization
    mySmartUpload.initialize(pageContext);
      
    // Upload
    mySmartUpload.upload();String path = mySmartUpload.getRequest().getParameter("PATH")
      

  5.   

    SmartUpload.initialize(config,request,response); 中的config,request,response
    private ServletConfig config;
        private ServletResponse response;
        PageContext pageContext;
     ServletRequest request;
    这样定义对话.
      

  6.   

    SmartUpload.initialize(config,request,response); 中的config,request,response
    private ServletConfig config;
        private ServletResponse response;
        PageContext pageContext;
     ServletRequest request;
    这样定义对话为什么不对啊?
      

  7.   

    JSP环境中用
    mySmartUpload.initialize(pageContext);servlet中用
    SmartUpload.initialize(config,request,response);