aspose file tools*
The moose likes JSF and the fly likes Exception Handling: where? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Exception Handling: where?" Watch "Exception Handling: where?" New topic
Author

Exception Handling: where?

Majid Al-Fifi
Ranch Hand

Joined: Aug 22, 2006
Posts: 45
I have a JSF app.

There is one class that interacts with all the views(ControllerClass). Only this class has info about the views. this class has another class to handle database access(DBManager).

This database access class doesn't know anything about the views.

I want to inform the views about what is happening in the database but that should be done thru DBManager.

how can I do that? shall i return exceptions to DBManager and if there are no exceptions and operation was ok how can I inform about that?

Thanks,
Majid


SCJP1.4, SCWCD1.4
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Moving to our JSF forum.


[Jess in Action][AskingGoodQuestions]
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Not understood your question exactly, please ellaborate more or paste some code to show what do you want to achieve.
Majid Al-Fifi
Ranch Hand

Joined: Aug 22, 2006
Posts: 45
Controller class has a method


DBManager:


now what is the best way to communicate to the controller what happened with the DBManager. I don't want to access the view from DBManager(not good design)

Thanks,
Majid
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Use FacesMessage to display your message on the view. It can be of type INFO, WARNING, ERROR or FATAL.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception Handling: where?