wood burning stoves 2.0*
The moose likes Servlets and the fly likes Class to Encode a string for a url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Class to Encode a string for a url" Watch "Class to Encode a string for a url" New topic

Class to Encode a string for a url

Adam Dear

Joined: Oct 21, 2003
Posts: 13
Does anyone know where I might find a class that will convert a normal string into one that is formated for a url? What I mean is if I pass it a string:

This is a string

I want it to return:


so that I can append this to a url in an anchor tag which is generated through a servlet, bean, jsp or whatever.

Dave Robbins
Ranch Hand

Joined: Sep 16, 2003
Posts: 131
this works for me

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60055


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Class to Encode a string for a url
Similar Threads
URL problem with Hash symbol
uncomfortable syntax
doubt regarding strings
Connection Pool
Hash symbol # problem in URL