model view controller - How does business logic class calls methods inside a managed bean? -


i have business logic code renders facesmessages on facelet based on output, made method in facelet managed bean method:

public void renderfacesmessages(string summary, string detail) {     facesmessage message = new facesmessage(summary, detail);     facescontext.getcurrentinstance().addmessage(null, message);  } 

and business logic class pass arguments method according message that's needed, question right approach business logic call method on managed bean?

it layering concept...

i presume have managedbean has method delegate business logic seperate business class/module. if case,i tell ,never have faces methods on business side...

instead have business results wrapped in class , return managed bean.this result class encompass results,meta information result like,errors,exceptions.so managed bean can use renderfacesmessage method

even if had not followed above presumption:my suggestion never have jsf faces logic inside business components.it bad idea.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -