• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

repalces my #sign with %23 (HEX of #) in URL which i don't want

 
zainu Mehmood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
In liferay portalURL repalces my #sign with %23 (HEX of #) in URL which i don't want.
using following code


where messageID contains a URL which has a # sign in it. I need # sign because i want to open my page from a specific location not from the beginning.

Any suggestions.


 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you have to encode it.
 
zainu Mehmood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bosun,
Thanks for the reply. But i guess here encoding is the problem. I mean liferay is already doing encoding and converting # sign into %23. While i don't need it.
Even then i tried to encode my URL after your reply with java URL encoder but it does not solve my problem rather it generates now www.myurl.com%2523link which was www.myurl.com%23link before my encoding. What i need is simply www.myurl.com#link .

I am sorry if misunderstood your answer.

Regards.
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want an anchor in your URL then. I expect you didn't know the right word for that thing. But now you do, so now you can search the documentation (or the Internet) using the right words.
 
zainu Mehmood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul,

Thank you very much for your reply. I am sorry if i was unable to explain my problem in a good way. I do know about anchor but thats not the question. My Question is very simple and that is that Liferay is converting # into a hex value( %23) into my URL. I don't want this because only with # sign in URL i can go to the specific paragraph. With %23 in URL it doesn't go to the specific paragraph but when i do replace manually %23 with # in address bar of browser, every thing works fine. I hope now you will understand my problem.

Regards.
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already understood your problem. You didn't understand my suggestion, which was to look for documentation which explains how Liferay supports anchors in URLs. What you tried didn't work, as you can see. Complaining that Liferay didn't handle it the way you wanted is pointless. You have to find out the right way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic