You basically have 2 options:
1) Keep id
as Path Variable and escape the #
As already mentioned in the comments #
is a special character in URIs normally reserved to refer anchor positions on the webpage. If you want to use it as a path variable you will have to escape it:
http://localhost:8080/abc/123%23qqq
Will yield your desired id = 123#qqq
2) Use a Request Parameter instead
This seems to to me the cleaner solution. If you have to have the #
as part of your id, you should propably just encode it as a String in a request parameter:
public void fooBar(@Requestparam String id) {
// do stuff
}
This way you won't have to worry about URI encodings since your #
character will be interpreted as a String.