You cannot show a warning from the controller. There is a one-way message from the client to the server. Therefore, the server cannot tell the client to do anything. Client and server requests provide an answer.
Therefore, you need to use javascript when the response returns to show any mailbox.
OR
using jquery on a button that invokes a controller action
<script> $(document).ready(function(){ $("#submitButton").on("click",function() { alert('Your Message'); }); }); <script>
Murdock
source share