Help with throwing error messages captured inside a backing bean to browser

I am using Sun's RI for java server faces. Now if inside the backing bean i catch any exception i would like to throw some meaningful message to the user (ie would like to throw the message in the browser ).The message should be formatted with style class. Is there any standard way of doing this in JSF?If yes then can you provide me with the relevant code?

I would like to keep this error throwing mechanism uniform across the application.

[455 byte] By [subhrajyotia] at [2007-10-2 21:35:17]
# 1
in the beanFacesCotext context = FacesCotext .getCurrentInstance();context.addMessage(null,new FacesMessage("There is something wrong"));return null;in the page put:<h:messages styleClass="css class here" />
amitteva at 2007-7-14 0:49:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks....The problem is solved but why to put that return null
subhrajyotia at 2007-7-14 0:49:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...