Thread: [Simpleweb-Support] getParameterValues method on simple.http.Request
Brought to you by:
niallg
From: Dennis W. <de...@gu...> - 2006-03-23 01:22:41
|
Hi, I need to handle URLs with multiple values for the same CGI variable such as: http://simple.server.com?a=1&a=2&a=3 According to the Simple documentation the Parameters interface "follows the parameter methods found in the Java Servlet API Specification." This means I should be able to get multiple values out using the getParameterValues like so: String[] a = req.getParameterValues("a"); But I don't see this method in the Simple javadoc and it breaks when I try and complie my program with this method. How can I get multiple values for a single named variable? TIA, Dennis |
From: Carfield Y. <car...@gm...> - 2006-03-23 03:57:47
|
May be use Request.getParameters() that return Parameters ?? On 3/23/06, Dennis Watson <de...@gu...> wrote: > Hi, > > I need to handle URLs with multiple values for the same CGI variable such= as: > > http://simple.server.com?a=3D1&a=3D2&a=3D3 > > According to the Simple documentation the Parameters interface "follows t= he > parameter methods found in the Java Servlet API Specification." This mea= ns I > should be able to get multiple values out using the getParameterValues li= ke > so: > > String[] a =3D req.getParameterValues("a"); > > But I don't see this method in the Simple javadoc and it breaks when I tr= y and > complie my program with this method. > > How can I get multiple values for a single named variable? > > TIA, > > > Dennis > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Dennis W. <de...@gu...> - 2006-03-23 16:20:41
|
Hi Carfield, On Wednesday 22 March 2006 19:57, Carfield Yim wrote: > May be use Request.getParameters() that return Parameters ?? That will return a Parameters object with all of the CGI variables, but I don't think it helps in this case. I need to handle CGI variables with multiple values, not just multiple CGI variables. Consider what happens when you are receiving data from a form with check boxes on it. You will have a single CGI variable with multiple values (one for each box checked). The servlet spec has the method String[] getParameterValues() to deal with such cases, but I don't see this for Simple. Dennis > On 3/23/06, Dennis Watson <de...@gu...> wrote: > > Hi, > > > > I need to handle URLs with multiple values for the same CGI variable such > > as: > > > > http://simple.server.com?a=1&a=2&a=3 > > > > According to the Simple documentation the Parameters interface "follows > > the parameter methods found in the Java Servlet API Specification." This > > means I should be able to get multiple values out using the > > getParameterValues like so: > > > > String[] a = req.getParameterValues("a"); > > > > But I don't see this method in the Simple javadoc and it breaks when I > > try and complie my program with this method. > > > > How can I get multiple values for a single named variable? > > > > TIA, > > > > > > Dennis > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting > > language that extends applications into web and mobile media. Attend the > > live webcast and join the prime developer group breaking into this new > > coding territory! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <gal...@ya...> - 2006-03-23 17:15:09
|
Hi Dennis, The Parameters object used to have a getParameters() method that returned multiple values for a single name. I removed it some time ago. I had been meaning to add it back, however I have not got around to it. Take a look at release 2.6 and you'll see the code for it in ParameterParser.insert. You can just plug this in, ill try to add this feature back. Niall --- Dennis Watson <de...@gu...> wrote: > Hi Carfield, > > On Wednesday 22 March 2006 19:57, Carfield Yim > wrote: > > May be use Request.getParameters() that return > Parameters ?? > > That will return a Parameters object with all of the > CGI variables, but I > don't think it helps in this case. I need to handle > CGI variables with > multiple values, not just multiple CGI variables. > > Consider what happens when you are receiving data > from a form with check boxes > on it. You will have a single CGI variable with > multiple values (one for > each box checked). The servlet spec has the method > String[] > getParameterValues() to deal with such cases, but I > don't see this for > Simple. > > > Dennis > > > > On 3/23/06, Dennis Watson <de...@gu...> wrote: > > > Hi, > > > > > > I need to handle URLs with multiple values for > the same CGI variable such > > > as: > > > > > > http://simple.server.com?a=1&a=2&a=3 > > > > > > According to the Simple documentation the > Parameters interface "follows > > > the parameter methods found in the Java Servlet > API Specification." This > > > means I should be able to get multiple values > out using the > > > getParameterValues like so: > > > > > > String[] a = req.getParameterValues("a"); > > > > > > But I don't see this method in the Simple > javadoc and it breaks when I > > > try and complie my program with this method. > > > > > > How can I get multiple values for a single named > variable? > > > > > > TIA, > > > > > > > > > Dennis > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by xPML, a > groundbreaking scripting > > > language that extends applications into web and > mobile media. Attend the > > > live webcast and join the prime developer group > breaking into this new > > > coding territory! > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > > that extends applications into web and mobile > media. Attend the live > > webcast and join the prime developer group > breaking into this new coding > > territory! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > that extends applications into web and mobile media. > Attend the live webcast > and join the prime developer group breaking into > this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Dennis W. <de...@gu...> - 2006-04-10 23:10:20
Attachments:
ParameterParser.diff
|
Hi Niall, I downloaded release 3.1 and release 2.7 and followed your advice about putting the insert(String, String) method back in. I created a patch file enclosed. Hopefully it's helpfull. The new class compiles and seems to work for basic cases. I guess I have to access the list of values via Parameters String[] getParameters(String) method? I have been using the convenience method Request String getParameter(String), so I will have to rewrite some to prove it works %100. Thanks, Dennis On Thursday 23 March 2006 09:14, Niall Gallagher wrote: > Hi Dennis, > > The Parameters object used to have a getParameters() > method that returned multiple values for a single > name. I removed it some time ago. I had been meaning > to add it back, however I have not got around to it. > Take a look at release 2.6 and you'll see the code for > it in ParameterParser.insert. You can just plug this > in, ill try to add this feature back. > > Niall > > --- Dennis Watson <de...@gu...> wrote: > > Hi Carfield, > > > > On Wednesday 22 March 2006 19:57, Carfield Yim > > > > wrote: > > > May be use Request.getParameters() that return > > > > Parameters ?? > > > > That will return a Parameters object with all of the > > CGI variables, but I > > don't think it helps in this case. I need to handle > > CGI variables with > > multiple values, not just multiple CGI variables. > > > > Consider what happens when you are receiving data > > from a form with check boxes > > on it. You will have a single CGI variable with > > multiple values (one for > > each box checked). The servlet spec has the method > > String[] > > getParameterValues() to deal with such cases, but I > > don't see this for > > Simple. > > > > > > Dennis > > > > > On 3/23/06, Dennis Watson <de...@gu...> wrote: > > > > Hi, > > > > > > > > I need to handle URLs with multiple values for > > > > the same CGI variable such > > > > > > as: > > > > > > > > http://simple.server.com?a=1&a=2&a=3 > > > > > > > > According to the Simple documentation the > > > > Parameters interface "follows > > > > > > the parameter methods found in the Java Servlet > > > > API Specification." This > > > > > > means I should be able to get multiple values > > > > out using the > > > > > > getParameterValues like so: > > > > > > > > String[] a = req.getParameterValues("a"); > > > > > > > > But I don't see this method in the Simple > > > > javadoc and it breaks when I > > > > > > try and complie my program with this method. > > > > > > > > How can I get multiple values for a single named > > > > variable? > > > > > > TIA, > > > > > > > > > > > > Dennis > > ------------------------------------------------------- > > > > > This SF.Net email is sponsored by xPML, a > > > > groundbreaking scripting > > > > > > language that extends applications into web and > > > > mobile media. Attend the > > > > > > live webcast and join the prime developer group > > > > breaking into this new > > > > > > coding territory! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > > > > _______________________________________________ > > > > Simpleweb-Support mailing list > > > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------- > > > > This SF.Net email is sponsored by xPML, a > > > > groundbreaking scripting language > > > > > that extends applications into web and mobile > > > > media. Attend the live > > > > > webcast and join the prime developer group > > > > breaking into this new coding > > > > > territory! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by xPML, a > > groundbreaking scripting language > > that extends applications into web and mobile media. > > Attend the live webcast > > and join the prime developer group breaking into > > this new coding territory! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > Niall Gallagher > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |