how to add mailto using outputLink
843842Apr 20 2006 — edited Apr 21 2006Hi,
I am creating a dynamic Table where Email address field is getting added dynamically.I need to know how can i add mailto with the email address.
I am doing following steps but it is appending the complete URL of the application before mailto:emailadress.
<h:outputLink value="mailto:#{emp.jobInfo.email}" id="emailLink">
<h:outputText value="#{emp.jobInfo.email}" />
</outputLink>
The output comes as http://servername:port/context path/mailto:emailadress
Looks like outputLink default adds the context path to the URL and to remove the context path we can add forward slash to remove the same.
I did some testing and found if i add 3 forward slashes infront of mailto the output i received is much better. http:///mailto:emailaddress . But still http:/// is still coming with the mailto and email part.I wanted to remove this also.Pls suggest. h:outputLink value="///mailto:#{emp.jobInfo.email}" id="emailLink">
If somebody has any solution to this problem pls respond.
Thanks, -Ritu