当页面pos向servlet时,如何提取取单的内容?
request.getParamter()总是得到一个null,何解?!

解决方案 »

  1.   

    String username = request.getParameter("username");
      

  2.   

    request.setAttribute()
    request.getAttribute()
      

  3.   

     java.lang.StringgetAuthType()           Returns the name of the authentication scheme used to protect the servlet.  java.lang.StringgetContextPath()           Returns the portion of the request URI that indicates the context of the request.  Cookie[]getCookies()           Returns an array containing all of the Cookie objects the client sent with this request.  longgetDateHeader(java.lang.String name)           Returns the value of the specified request header as a long value that represents a Date object.  java.lang.StringgetHeader(java.lang.String name)           Returns the value of the specified request header as a String.  java.util.EnumerationgetHeaderNames()           Returns an enumeration of all the header names this request contains.  java.util.EnumerationgetHeaders(java.lang.String name)           Returns all the values of the specified request header as an Enumeration of String objects.  intgetIntHeader(java.lang.String name)           Returns the value of the specified request header as an int.  java.lang.StringgetMethod()           Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.  java.lang.StringgetPathInfo()           Returns any extra path information associated with the URL the client sent when it made this request.  java.lang.StringgetPathTranslated()           Returns any extra path information after the servlet name but before the query string, and translates it to a real path.  java.lang.StringgetQueryString()           Returns the query string that is contained in the request URL after the path.  java.lang.StringgetRemoteUser()           Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.  java.lang.StringgetRequestedSessionId()           Returns the session ID specified by the client.  java.lang.StringgetRequestURI()           Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.  java.lang.StringBuffergetRequestURL()           Reconstructs the URL the client used to make the request.  java.lang.StringgetServletPath()           Returns the part of this request's URL that calls the servlet.  HttpSessiongetSession()           Returns the current session associated with this request, or if the request does not have a session, creates one. HttpSessiongetSession(boolean create)           Returns the current HttpSession associated with this request or, if if there is no current session and create is true, returns a new session.  java.security.PrincipalgetUserPrincipal()           Returns a java.security.Principal object containing the name of the current authenticated user.  booleanisRequestedSessionIdFromCookie()           Checks whether the requested session ID came in as a cookie. booleanisRequestedSessionIdFromUrl()           Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead. booleanisRequestedSessionIdFromURL()           Checks whether the requested session ID came in as part of the request URL. booleanisRequestedSessionIdValid()           Checks whether the requested session ID is still valid. booleanisUserInRole(java.lang.String role)           Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
      

  4.   

    晕.....,就是getParameter("xxx")取不到,取回的是一个null:
    可能存在的问题:
    1. 服务器 save
    2. 大小写 save
    3. 在HTML中没有使用nmae="xxx" save
    问题还在是存在,重装eclpise后好了.