W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1999

FW: How to correctly access/process query parameters send by a UR LConnection client

From: Zahid Ahmed <zahid.ahmed@commerceone.com>
Date: Wed, 1 Sep 1999 15:56:59 -0700
Message-ID: <F289FD995459D311BBCF00A0C9E91ABF023436@ip5-13.5.20.172.in-addr.arpa>
To: www-jigsaw@w3c.org
1. I'm trying to send a query parameter (key-value pair)
from a HTTP/Java client by initializing the URL with
initializing a java.net.URL of the following format:

protocol://hostname:port/servlets/targetServlet?key=value

At run-time, on the client side the URL external form
looks fine.

However, on the Jigsaw Server side, I'm attempting to
process the request's query parameters without success:

 private void getQueryParameters(Request request, String key)
 {
     String query = request.getQueryString();
     Debug.log.debug("query: " + query);
     String value = null;
     String name = key;
     Hashtable urlParameters = null;

     if (query != null) {
          Reader qis = new StringReader(query);
          InputStream is = new ByteArrayInputStream(query.getBytes());
          try {
              //urlParameters = new URLDecoder(qis, false).parse();
              urlParameters = new URLDecoder(is, false).parse();
              value = (String) urlParameters.get(name);
               } catch (Exception ex) {
                    ex.printStackTrace();
                                    /
                     }
     }
 }


The Jigsaw Server finds the value of the query string to always
be null. Why?? The java client is sending a non-null query
string as part of the URL initialization.

2. Also, would it be OK, to add a 3rd field as a authentication parameter in
the client-side HTTPCredential and send as part of the basic cookie? It
seems to be received by the Jigsaw Web Server fine
(in addition to userId/password)? Obviously, this would mean that
we will need to write our own custom auth handler on server side.
E.g., 
 HTTPBasic decoded cookie: 3rdAuthfield:userId:password

Will the 3rd field added to HttpCredential as part of basic cookie
impact any standard WWW proxy authentication?


thanks,
Zahid
Received on Wednesday, 1 September 1999 18:59:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:33 GMT