Difference between multiple messaging components in Visualforce Page?

Difference between multiple messaging components in Visualforce Page

  • It is used for display a message for a specific component, such as a warning or error.
    <apex:message></apex:message>
    
  • It is used for display all messages for all components on the current page, such as a warning or error.
    <apex:messages></apex:messages>
    
  • It is used for displaying custom messages in the visualforce page using the Salesforce pattern for errors, warnings and other types of messages for a given severity.
    <apex:pagemessage></apex:pagemessage>
    
  • It is used for displays all the messages that were generated for all components on the current visualforce page, presented using the Salesforce styling.
    <apex:pagemessages></apex:pagemessages>