Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
How can I share custom text to WhatsApp using a button for a JSF application?

So I want to share custom text to WhatsApp on the press of a button. So far I have used the href tag to redirect me to the WhatsApp page but the text needs to be put in the url itself. I'm looking for a way to generate custom URLs in my href tag. This is what I have now:

 <p:button value="Share to WhatsApp" target="_blank" href="https://api.whatsapp.com/send?text=Static text!"
    icon="fab fa-whatsapp" styleClass="ui-button-outlined"/>

And I want to implement something like

 <p:button value="Share to WhatsApp" target="_blank" href="#{getUrlWithCustomText()}"
    icon="fab fa-whatsapp" styleClass="ui-button-outlined"/>

where the function getUrlWithCustomText() can be something like

public String getUrlWithCustomText(String customText)
{
   return "https://api.whatsapp.com/send?text="+customText;
}

But href does not support expression language. I cannot use javascript for this project so I need a solution in Java. Any help is appreciated!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!