It wont be possible to give a friendly message from within the application - since the application /myapp
itself is not available.
The usual way to handle this is at the web server level - where you set up another temporary site when your application is out due to maintenance. Redirect all requests to a friendly error message.
No requests will come through to the app server. Any bookmarked URLs will also get the out of service page from the alternate app.
A detailed approach is given at http://www.webreference.com/programming/Apache-Site-Down-Notice/
If you do not have a web server in your setup, then you can set up the maintenance page (some index.html) on another web app setup with the same context mapping to /myapp
When your EAR is down, bring up that one.
For JBoss I think you can change the location of the 404 page by setting it in
server/xxx/deployers/jbosssweb.deployer/web.xml
You'll have to make this point to some page OUTSIDE of /myapp