Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda