Message Boards

Generate URL from the given String

Logu R, modified 8 Years ago.

Generate URL from the given String

New Member Posts: 10 Join Date: 5/15/15 Recent Posts
The concept is "We need to generate URL from the given String ".
For example,
1)
Here the urltext contains "www.google.com"
urlText ="www.google.com"

2)
Now i tried to append the string with "https:"
urlTemp = "<a target='_blank' href='https://"+urlText+"'>";

The issue is while executing the application it is referring to our local port.
http://localhost:9080/web/guest/www.google.com

It should be https://www.google.com
thumbnail
David H Nebinger, modified 8 Years ago.

RE: Generate URL from the given String

Liferay Legend Posts: 14916 Join Date: 9/2/06 Recent Posts
There's gotta be more to it than that. If you output that <a target... /> tag as indicated, it would not be stamped with the local host prefix.