Wednesday, November 14, 2012

Struts tutorial 1: basics of J2EE

Q> what are the different logic of web enabled enterprise java application?
Ans==> 1>UI logic (user interface)(presentation logic)
                   a)output generation logic(code)
                   b)flow control logic
             2>Business logic
                   a)data processing logic
                   b)data accessing logic

Q> What is the objective of Struts?
==>UI layer i.e. presentation layer of java enterprise application development.
==>struts provides support in output development and flow control development.
==>struts does not support business logic development but allows any business component to provide
       data processing service.

Q>What are the different architectures suggested by Sun Microsystems for Java based web application
      development?
 ==>JSP Model I Architecture(page centric)
==>JSP Model II Architecture(MVC)

Q>Explain about JSP Model I Architecture.
==>JSP+Servlet=Front End(UI Layer).
1. JSP receiving the client request and capturing the user input(flow control logic)
2. JSP calling the business method of java beans of java bean for data processing .
3. java bean accessing the data from database, processing data according to the business rules of
    enterprise and holding the processed data.
4. JSP getting processed data from java bean.
5. JSP producing the response page and sending to the client(via web server)

==>In this architecture, JSPs of the project have 2 logic mixed=>view logic (output generation logic)
                                                                                                =>flow control logic
==>business logic is separated from JSPs and encapsulated into java bean i.e. Java Bean is acting as model
       component
==>As 2 logic are still not separated, this architecture is not used in large applications.
==>A JSP is a web component. But it is strong as view component and not as Controller component