This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 75653

Summary: Error handling enhancement for generated Entity/JSF functionality
Product: javaee Reporter: rlubke <rlubke>
Component: JSFAssignee: Pavel Buzek <pbuzek>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description rlubke 2006-04-28 01:49:09 UTC
Currently, the generated Controller classes will add a FacesMessage when
performing a create or update operation.  This FacesMessage has a sererity of
ERROR - even for a success message.

Now, the generated JSF page uses the h:messages component to capture said messages
and applies a global style of 'color:green'.

Finally, if there is an error inserting a row, nothing is propagated to the
client.  You have to go look at the server log to find out what happened, but
the JSF page, has a nice green success message at the top.

Here is how I suggest things should work.

In the Controller, have two helper methods - addSuccessMessage(String) and
addErrorMessage(String).  The addSuccessMessage(String) will add a FacesMessage
with a severity of INFO, while addErrorMessage() would basically do what the
current addMessage() implementation does.

Then, on the JSF page, leverage the fact that you can specify multiple CSS
styles for the different FacesMessage serverities (i.e. infoStyle, and errorStyle).
Comment 1 Pavel Buzek 2006-04-29 19:03:04 UTC
*** Issue 75675 has been marked as a duplicate of this issue. ***
Comment 2 Pavel Buzek 2006-04-30 02:54:04 UTC
displaying incorrect messages is a defect, not enh
Comment 3 Pavel Buzek 2006-04-30 03:02:48 UTC
Ryan, thanks for great feedback and suggestions!

fixed:
http://web.netbeans.org/source/browse/web/jsf/src/org/netbeans/modules/web/jsf/wizards/JSFClinetGenerator.java?r1=1.1.2.6&r2=1.1.2.7
Comment 4 Lukasz Grela 2006-07-20 14:51:00 UTC
v.