Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pound Sign in SQL Result String - can't pass in URL

843841Feb 24 2004 — edited Feb 25 2004
I am retrieving data with an SQL statment into a result set (string contains a pound sign), then I need to pass that value along to another jsp page (in the form of a value in a URL to an update page). When it gets to the new page it apparantly doesn't like the character. It doesn't display any characters from the pound sign to the end of the string or any other values in the URL string that come after that. I found some specification on the URL to change the pound sign to a percent23. If I type that value into the URL (percent23 in place of the pound sign) this works and will display the parameter correctly.

I have been trying to use the replace method once I get my field value from the result set and haven't been having any success. I tried using
String s = s.replace("\#", "\%23");
, and have gotten different error messages. Invalid character constant, invalid escape character, etc. depending on how I try to use the method. I even tried the
String s = s.replaceAll("\#","\%23");
, and that gives me a class not found exception error.

I am still fairly new to java and would appreciate any help. Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2004
Added on Feb 24 2004
7 comments
497 views