Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Using getParameter with long URL string

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My query string in my HTTP request is http://localhost/Servlet?tid=123456?pay=32bbcef5b15ffbf9a10106dc708d0bb9ec507caa490797bd50db66fb3a0f87304973357364c29e3a550e8f0ba9b06ec280d036ef83888b08c26cb70f0489da7a9c5253f636310d5661ca42ddbdb106743bafbaf380853ee31776ba0a53c82bdd039bd2282afa7cf3930bd804e46a303c30872b332cf12ecc56965cbc0aa55a089242c40042926524e57b760356c6000e6beedba14b0e44666edafa3c6867623dfac1c9615c6e6d567d5a6e2a264e65361b45c92f304592d2

When I say getParameter("tid") I get back "123456?pay=32bbcef5..." and getParameter("pay") yields null.

Why don't I get the "123456" for parameter tid and "32bbcef5..." for parameter pay ?

Does it have anything to do with the long URL string?
 
Marshal
Posts: 26912
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, it's simply that the URL parameters should be separated by & characters. So it should go ...Servlet?tid=123456&pay=32bbce....
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getParameter assumes that the URL is properly formed.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic