• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing url(with parameters) as a parameter

 
axel garcia
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have servlet that parses a url feed which takes parameters in the form of:
http://theirsite/xfeeds/feed1?q=99&p=2345
Basically, my parser will get the contents by creating a URL object and reading the output lines.

i've tried the form http://mysite/parser/myparser1?url=http://xfeeds/feed1?q=99&p=2345,
but this one chops off the url parameter after q=99, after hitting the "&".
i've tried http://mysite/parser/myparser1?url='http://xfeeds/feed1?q=99&p=2345',
but this one treats the first apostrophe as part of the url parameter and my URL blows up.

anybody tried this? any suggestions?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Values should always be URL-encoded, especially other URLs.
 
axel garcia
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Values should always be URL-encoded, especially other URLs.


thank you for the useless comment. pontificate somewhere else. how do i filter you out?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Axel,
Bear was giving you the answer. You need to encode the "?" and "&" in the url parameter so they don't get treated as separate parameters.

Let's also keep in mind the rule of this forum is to be nice. Saying someone's comment is useless isn't nice. And Bear is one of the moderators of this forum - a moderator isn't likely to give useless comments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic