After doing the basic setup for the project as described earlier, I noticed that the default exception page lacked the detail normally included in tapestry. I could still get it from the Netbeans log window, but that's pretty cumbersome because it just isn't laid out as nice.
It turns out that Tapestry 5 defaults to "production-mode" in order to hide all the excess information from users. Only a summary message is shown.
The easiest way to ensure that production-mode is off when testing in Netbeans and when deployed to your server is to specify a flag in the VM settings of your server. Note that putting this into the VM settings of the project doesn't work reliably.
In Netbeans, under Services, Servers right click on Apache Tomcat 6.0.xx and select the Platform tab and in the VM Options box enter: -Dtapestry.production-mode=false
Restart the sevice and you should be golden.
To make the setting at the application level or so the production mode is off while deployed on a server (while beta testing for example), edit the web.xml and add the following lines:
<context-param>
<param-name>tapestry.production-mode</param-name>
<param-value>false</param-value>
</context-param>
Just make sure to go back later and edit the web.xml and remove or change this to true (the default is true) if you want to deploy on a live server without the exception detail.
You can also define tapestry.exception-report-page (in web.xml) and program your own exception page in which you might be able to do something like Cold Fusion does, and specify that error detail only gets displayed to certain client IP addresses, which is handy if you want to diagnose a problem in something that's already running on a live server. Primarily this custom exception page function is intended to be used for displaying a user friendly error page, but you can do pretty much anything you want.
Monday, March 22, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment