File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes repalces my #sign with %23 (HEX of #) in URL which i don't want Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "repalces my #sign with %23 (HEX of #) in URL which i don Watch "repalces my #sign with %23 (HEX of #) in URL which i don New topic
Author

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

zainu Mehmood
Ranch Hand

Joined: May 09, 2007
Posts: 45
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

Joined: Nov 06, 2000
Posts: 1506
Then you have to encode it.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
zainu Mehmood
Ranch Hand

Joined: May 09, 2007
Posts: 45
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
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

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

Joined: May 09, 2007
Posts: 45
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
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: repalces my #sign with %23 (HEX of #) in URL which i don't want
 
Similar Threads
How to Configure SSL over Database in Spring?
EditAction not called on liferay
"struts_action" param inside renderURL tag for liferay's MVCPortlet
liferay portlet - form parameters missing from request
linking jsp pages in a liferay portlet