Salesforce Visualforce Page

Salesforce

How to display a success message on Visualforce page when button is clicked?

Sample Code: Visualforce page: <apex:page controller="Sample">              <apex:form >                  <apex:pageBlock >                          <apex:pageMessages />                          Testing Page Message                              <apex:pageBlockButtons location="bottom">                                  <apex:commandButton value="Call" action="{!check}"/>                                  </apex:pageBlockButtons>                          </apex:pageBlock>                  </apex:form>          </apex:page>   Apex Class: public class Sample {          public Sample() {   ....