Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why do I see strange characters appended to my URL  RSS feed

 
mike zhang
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • 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
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • 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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Sunny Liu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
You may use post method instead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!