title: How to show alert message based on server response in JSF
body: <p>I have the following link in one of my JSPs. When an user clicks on that link I'm calling an action in my backing bean. I need to show a JavaScript alert message based on the response of that action.</p>
  
  <pre><code>&lt;h:commandLink onclick="setSelectedClientAndFund();" id="next"
    action="#{fyeSelection.getFYEReportHome}"&gt;
      &lt;h:graphicImage value="../images/NextBT.png"&gt;&lt;/h:graphicImage&gt;
      &lt;a4j:loadScript src="alert('hello');"&gt;&lt;/a4j:loadScript&gt;
  &lt;/h:commandLink&gt;
  </code></pre>
  
  <p>How can I achieve this?</p>