• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why do I see strange characters appended to my URL

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a servlet that does a "forward()" to a destination JSP page, so eventually I see the content of the destination JSP page, but on the URL part, I saw not only the servlet name plus hidden variables, parameters, but also at the end of URL I saw some strange characters like:
CiScope=%2F&IDQFile=%2Faspsrch%2Fblssearch.idq&SearchArea=%2F&CiSearch=
the interesting thing is: when copy and paste the whole URL string, it can be bookmarked, i.e. another new browser window can see the result page.
why ? How to fix it ?
Thanks,
Mike
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Request parameters/values are appended to the end of the URL if you are using doGet in your servlet, or if you don't specify a method at all, in which case it defaults to doGet. If you are, you need to implement doPost instead.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing to fix. Those are URLEncoded characters that otherwise would screw up the HTTP protocol for a GET.
 
mike zhang
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the response. I did use the doGet method. If that's what it should be, then I am bit confused: I have another similar servlet/JSP application, it never shows these kind characters, why ? Plus, I want to have the final result JSP page to be able to be bookmarked. It's strange to give user such a URL. Of course I tried to bookmark only the URL characters without the last strange part, it works. The point is: is there anything to let the last encoded part disappear from the URL ?
Thanks,
Mike
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike,
You may use post method instead.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic