# Web Development > JSP Writing Bussiness Logic using struts framework

## katipelly

Where do I write Bussiness Logic that using struts framework? is that we write in action class? or any?

----------


## vmshenoy

> Where do I write Bussiness Logic that using struts framework? is that we write in action class? or any?


Yes, business logic is written in action class.There is one action class for each module  , say, for eg if u have login module, then u can have LoginActionClass.java , where u can implement business logic.

----------


## vinotha

Hi,

you have to write the business logic in EJBs.
and call the EJBs from Action class.
Action will make decision like which JSP page has to be called next

----------


## srinivasdumpala

Never implement business logic in action class,its not recommended.its visible to client and  its tight coupled.
Always delegate the biz logic using form beans or DTO or EJB.

Action is only controller, it handles request from actionservlet and forwarding to view pages.

----------


## JaiBharath

Never think of putting business logic in the action classes. Its not the way to work using struts. Action classes r only to act as a controller which delegates the control to some DAO, EJB objects. So always put ur business logic in DAO or EJbs...while using struts framework

----------


## nagadeepa

No business login should be written in a Model class which can be called from Action class.


       we can write BL in Action class even but the if u want the same BL to be applied for an GUI application we need to write the same BL code again.

       But if we write the BL code in  Model class this can used by Action class of Struts Frame work as well as GuI application also

----------


## malli1mca07

it is better to write BL in either POJo(PlainOldJavaClasesses)/EJB

----------


## munaverbasha

Hi i am new person to Java struts,may i know the clear definition of business logic and presentation logic with example and purpose of that, what will do,why we are using....please help me......

----------

