Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using getParameter with long URL string  RSS feed

 
Graham Greene
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getParameter assumes that the URL is properly formed.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!