Powered by Blogger.

4) . Inner Communication in Struts

>> Friday, May 29, 2009

The communication between files or modules.

1. ActionServlet
2. JSP's
3. Web.xml
4. ActionBeans / FormBean
5. ActionClass
6. ActionForward
7. Struts Configuration file
Inner Communication in Struts will happen_JavabynataraJ

3. Introduction to Struts.

>> Thursday, May 28, 2009

Struts:

  • TYPE : FrameWork Software to develop web application
  • VERSION : Struts 1.x(1.38) compatable with J2SDK 1.4 , 2.x(2.0.11) compatable with J2SDK 1.5.
  • VENDOR : Apache Foundation
  • Open Source Software
  • Download Software as Zip file from www.apache.org
  • For Help : www.struts.apache.org
  • For FAQs : www.forum.apache.org
  • Author: Craig mccallam
  • Online Tutorials : www.roseindia.com
  • Books : struts 1.x , Jakarta books(O'rielly press)
  • Complet reference of Struts(O'rielly press
  • Struts 2.x, Black Book
Struts 1.x Software.
  • Base Framework Software
  • Puugins
Validator plugins
Tiles plugins
  • Documentaiton
  • JSP Taglibraries
  • Example Applications
Installing Struts software but extracting zip file .(Struts 1.3.8-all.zip)file to a folder.
--> A plugin is a readymade solution configurable with applications.
--> JSP tag library is a library that contains set of readily available JSP tags. Struts 1.x Softwares gives six numberof JSP tag libraries. And these tags are JSP tag libraries are useful to make JSPs of webg applications as java codeless JSPs.
--> To make JSP as Java code less JSPs avoid scripting tags(scriptlet,expression,declaration),tags in JSP programming.

Note 1: Opensource software means not only free softwares , all the sources used to design and devolop a software will be given along with software installation.
Note 2: In strts based webapplications controller servlet is built in servlet and its name is action servlet. ActionServlet is given as HttpServlet.
  • According to java language API is nothing but set of classes and interfaces which come in the form of packages.
  • Struts API means working with classes and interfaces of org.apache.struts.package, and its subpackages.
  • To get help regarding struts-api,JSP tag libraries and XML files of struts use struts-home/docs/index.html file.
// The API given by thirdparty organization(other than sun microsystems) will come as jar files.
  • Struts software is always given by apache foundation, so it is giving struts API in the form of strutshome/lib/struts-core-version.jar file and this jar file is having multiple dependent jar files in the same tag.
  • Struts software installation gives example web application in strutshome/apps folder. The directory where struts software is installed(zip file is extraced) is called struts home directory.
//Setup required for Struts 1.x based application is nothing but developing normal web application by adding struts api support.

2. Introduction to FrameWork

In MVC architecture based webapplication we use JSPs in view Laer servlet in controller Layer. JavaBean, EJB, Spring with Hibernate technologies in model layer.
Q. What happens if interchange technologies of these layers.?
A. We can change rolls of these technologies , but it is not recommended to do.

Reasons: If servlet is taken as view layer component

  • preesntation Logic of the webapplication changes at regulat intervals.
  • If source code of servlet is modified we need to recompile the servlet and we need to reload the webapplication.
  • If Source code of JSP is modified these is no need of recompiling JSP and reloading the webapplication.
  • Since presentation logic of webapplication changes regularly it is recommended to take JSP s as View components.
If JSP is taken as Controller
  • Integration Logic of controller is always java code.
  • Keeping Java Code in JSP is not industry standard.
  • It is always recommended to develop JSP as java codeless JSP.
  • If JSP is taken as controller it will be forced to have java code,representing integration logic which is not a recommended operation.So always prefer taking servlet as controller.
Note.:Only webComponents(Servlets, JSPs) can acts as controller Because they only can take Http request given by browser. So we can't see JavaBean, EJB, Hibernate and spring applications as controller because they can't take Http request.
These application can't act as view Layer application because they are not capable of generating web-pages.
  • If Seperates or another Servlet/JSP is taken as model layer components.
  • Business Logic placed in Servlet/JSP gives following limitations.
  • Allow only HttpClients(browsers) to access the business logic.
  • Business Logic becomes specific to one webapplication(businessLogic is not reusable).
  • Middleware services must be implemented manually.
  • To overcome these problems use EJB, Spring with hibernate to develop business logic of model layer,and take the advantage of reuability of business logic built in middle ware services under capability of allowing all types of java applications as clients(Both Http & Http Clients).
Note: Browsers are called HttpClients. Java application, awt, spring applications are called non HttpClients.

Framework is a special software that is capable of developing applications based on certain architectuere havingg ability to generate common logics of applications devolopment dynamically.
Due to framework software program need not to develop of all the logic of application. He just need to concentrate only on the logics that are specific to our applications.
Strut is a web based frame work software to develop MVC architecture based webapplication having capability of generating integration logic of controller Servlet dynamic calls.
In Struct based webbased application controller servlet is built in servlet and its integration logic will be generated dynamically By struct framework software . So programmer needs to develop only presentation , business logics.
  • Struts framework Software is designed by using servlet JSP technologies has underlaying technologies.
  • In strut based web application, MVC priciple will not be violated , because it experts source code files to programmer according to MVC principles.
  • By using struts frame work software complex operation of web application can be done easily with the support of built in wizards and (Phonics).
  • If web application developed manually with out using framework softwares are based on MVC architecture programmer needs to develop all the applications manually.
  • Compare to mannual implementation of MVC architecture(with out framework software) to develop web applications the framework software based web applications can be developed fastly.
Struts ----> Apache
JSF ----> Sun MicroSystems
Cocoon ----> Adobe
Webwork ----> OpenSymphony
Spring MVC----> Interface21.
TapStray ----> OpenCommunity
ASP.net ----> MicroSoft

Note : All java based webframe work softwares are given based on servlet JSP technologies.

Disadvantages of MVC Architecture

>> Wednesday, May 27, 2009

In the development of MVC architecture based web application not only we need to use multiple technologies , but we also need to use(follow) set of rules in the development of web application. Also for parallel development of application more programmers with knowledge on multiple technologies is required.
Disadvantages of MVC Architecture_JavabynataraJ

Advantages of MVC Architecture

Currently most of the developers are working on MVC (Model,View,Controller) design pattern to develop web applications. Before going to the key points of Advantages of MVC architecture, just recollect the Structure of MVC .Model,View and Controller are the three components to separate logic to reuse entire the application. Developer role will become specific on particular layer and development of application will become easy.
Advantages of MVC Architecture_JavabynataraJ 

1.3. MVC Architecture Layers

In MVC architecture based web-application development multiple layers will be involved like
  • Model layer
  • View layer
  • Controller layer

1.2. Limitations Of Model 1 Architecture

>> Tuesday, May 26, 2009

Since multiple logic's are mixed up in every web resources of web application there are no clean separation of logic's/rolls.

  • Modification done in one logic disturbs other logic of the web application parallel development is not possible due to this productivity is very poor.
  • Maintenance and enhancement of the project is always complex.
  • Programmer will be overburdens because he has to implement middle-ware services along with main logic's.
Advantages : Knowledge servlets of JSP is enough to develop the web-application.
  • Model 1 architecture is not a industry standard to develop the web-application.
  • To overcome the problem of Model 2 architecture use MVC architecture Model 3 architecture to develop the web-application.

1.Web Application introduction.

WebApplication is a collection of web resources like HTML files, JavaScript files, image files Servlets, jsps and etc.

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.