KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > servlet > http > HttpUtils

javax.servlet.http
Class HttpUtils

java.lang.Object
  extended byjavax.servlet.http.HttpUtils
See Also:
Top Examples, Source Code

public static StringBuffer getRequestURL(HttpServletRequest req)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public HttpUtils()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Hashtable parsePostData(int len,
                                      ServletInputStream in)
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static Hashtable parseQueryString(String s)
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[280]parseQueryString V. getParameterMap
By joe { at } xdobs { dot } com on 2003/06/24 21:47:06  Rate
// NOTE - parseQueryString is depcreated and has been replaced 
 // with getParameterMap (  )  in HttpServletRequest 
  
  
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   public void doGet ( HttpServletRequest request, HttpServletResponse response )  
       throws ServletException, IOException  
   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    {  
     // Output goes in the response stream. 
     String aKey = null; 
     String [  ]     val_arr = null; 
     String aVal = null; 
     PrintWriter out = response.getWriter (  ) ; 
     String qs = request.getQueryString (  ) ; 
     Hashtable aHash = HttpUtils.parseQueryString  (  qs  ) ; 
     Enumeration aka = aHash.keys (  ) ; 
     response.setContentType ( "text/plain" ) ; 
     while  ( aka.hasMoreElements (  )  )  
      {  
         aKey =  ( String )  aka.nextElement (  ) ; 
         val_arr =  ( String [  ]  ) aHash.get ( aKey ) ; 
         int ndx = 0; 
         while  ( ndx  <  val_arr.length )  
          {  
            aVal = val_arr [ ndx ] ; 
            System.err.println ( "aKey=" + aKey + " aVal=" + aVal ) ; 
            out.println ( "aKey=" + aKey + " aVal=" + aVal ) ; 
            ndx++; 
          }          
      }  // end while (  )  
     out.close (  ) ;     
    }  // end doGet (  )  
  
  
 // by joe@xdobs.com 
 // tested with jetty 
  
  
 

Popular Tags