Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing a url paramter to a servlet

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to pass a url as a parameter to a servlet?

For example, if I post:
http://www.mydomain.com/abc?param1=hello¶m2=http://www.google.com/search?hl=en&q=java&btnG=Google+Search

And then in my abc servlet:
String param1 = request.getParameter("param1");
String param2 = request.getParameter("param2");
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. But like any other data serving as a query parameter, it must be properly URL-encoded.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic