Java Programming Struts
03 October 08:31
This advertence is beneath development. All Struts developers are requested to accord and advice in accretion this reference
----
[http://struts.apache.org/ Struts] is the alotof accepted framework for developing Java based web applications. Struts is getting developed as an accessible antecedent activity started by [http://www.apache.org/ Apache Software Foundation ]. Struts framework is based on [http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html Archetypal Appearance Controller] (MVC) architecture.
This advertence is advised as an simple step-by-step adviser for Strut development. Clairvoyant is accepted to apprentice basal concepts of Struts through this advertence thats why no development accoutrement and aids will be used.
Action framework in a Nutshell
The framework provides its own web Ambassador basic and integrates with additional technologies to accommodate the Archetypal and the View. For the Archetypal , the framework can collaborate with accepted data admission technologies, like JDBC and EJB , as able-bodied as alotof any third-party packages, like Hide , iBATIS , or Item Relational Arch . For the Appearance , the framework works able-bodied with JavaServer Pages , including JSTL and JSF , as able-bodied as Acceleration Templates , XSLT , and additional presentation systems.
The framework s Ambassador acts as a arch amid the applications Archetypal and the web View. If a appeal is received, the Ambassador invokes an Activity class. The Activity chic consults with the Archetypal (or, preferably, a Bluff apery your Model) to appraise or amend the applications state. The framework provides an ActionForm chic to advice alteration data amid Archetypal and View.
Most often, the Archetypal is represented as a set of JavaBeans . Typically, developers will use the Aliment BeanUtils to alteration data amid ActionForms and the Archetypal altar (or a Facade). Preferably, the Archetypal will do the abundant lifting, and the Activity will act as a cartage cop or adapter.
Struts Config in a Nutshell
A web appliance uses a deployment descriptor to initialize assets like servlets and taglibs . The deployment descriptor is formatted as a XML certificate and called web.xml. Likewise, the framework uses a agreement book to initialize its own resources. These assets cover ActionForms to aggregate ascribe from users, ActionMappings to absolute ascribe to server-side Accomplishments , and ActionForwards to baddest achievement pages.
Heres a simple agreement (struts-config.xml) for a login workflow:
-//Apache Software Foundation//DTD Struts Agreement 1.3//EN
http://struts.apache.org/dtds/struts-config_1_3.dtd>
name=logonForm
type=app.LogonForm/>
path=/Welcome
forward=/pages/Welcome.jsp/>
path=/Logon
forward=/pages/Logon.jsp/>
path=/LogonSubmit
type=app.LogonAction
name=logonForm
scope=request
validate=true
input=/pages/Logon.jsp>
name=success
path=/pages/Welcome.jsp/>
name=failure
path=/pages/Logon.jsp/>
path=/Logoff
type=app.LogoffAction>
name=success
path=/pages/Logoff.jsp/>
There are several additional assets you can specify in the frameworks agreement file. You can specify validations for the ActionForms in an XML descriptor, using the Struts Validator . A accepted extension, Tiles , helps you body pages from abate fragments.
Struts Activity framework is extensible. Every chic deployed by the framework can be replaced by your own absence class. The backdrop of your absence chic can be set using the Digesters set-property feature. This is one cause why there are so some contributor extensions
tiles is a contributor extension
s Features
Screen definitions
Create a awning by accumulating Tiles : header, footer, menu, body, etc.
Definitions can yield abode :
in a centralized xml book
directly in jsp pages
programatically in struts accomplishments
Definitions accommodate an bequest apparatus : a analogue can extend addition one, and override parameters.
Layouts
Define accepted page layouts and reclaim them beyond your web site.
Define card layouts, and use them by casual lists of items and links.
Define a aperture layout, use it by casual a account of Tiles (pages) to show.
Reuse absolute layouts, or ascertain your own.
Dynamic page architecture
Tiles can be aggregate dynamically during page reload. It is accessible to change any attribute: layout, account of Tiles in portal, account of card items, etc.
Reuse of Tiles / Apparatus
If able-bodied defined, a Asphalt can be reused beyond assorted applications.
Dynamic attributes are acclimated to parameterize Tiles.
It is accessible to ascertain a library of reusable Tiles.
Build a page by accumulating predefined components, giving them adapted parameters.
Internationalization (i18n)
It is accessible to amount altered tiles according to Locale.
A apparatus agnate to Java backdrop files is acclimated for definitions files: you can accept one analogue book per Locale. The adapted analogue is loaded according to the accepted Locale.
Multi-channels
It is accessible to amount altered Tiles according to a key.
For example, the key could be user provilege, browser type, approximate name stored in session, etc.
A apparatus agnate to Java backdrop files is acclimated for definitions files: you can accept one analogue book per key. The adapted analogue is loaded according to the key.
Apart from basal compassionate of architecture a web application. The clairvoyant is appropriate to accept some array of alive knowlege in the afterward technologies.
Struts framework provides the afterward allowances over accepted methods of Web Appliance Development.
These allowances are acquired because Struts provides a arrangement based on the Archetypal 2 archetype of Java web appliance design, while aswell accouterment a framework for the appliance that is cleaner than a alternation of J2EE servlets.
Best practices : http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts.html
Example applications : http://sourceforge.net/projects/struts
Documentation : http://struts.apache.org/userGuide/index.html
----
[http://struts.apache.org/ Struts] is the alotof accepted framework for developing Java based web applications. Struts is getting developed as an accessible antecedent activity started by [http://www.apache.org/ Apache Software Foundation ]. Struts framework is based on [http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html Archetypal Appearance Controller] (MVC) architecture.
This advertence is advised as an simple step-by-step adviser for Strut development. Clairvoyant is accepted to apprentice basal concepts of Struts through this advertence thats why no development accoutrement and aids will be used.
Action framework in a Nutshell
The framework provides its own web Ambassador basic and integrates with additional technologies to accommodate the Archetypal and the View. For the Archetypal , the framework can collaborate with accepted data admission technologies, like JDBC and EJB , as able-bodied as alotof any third-party packages, like Hide , iBATIS , or Item Relational Arch . For the Appearance , the framework works able-bodied with JavaServer Pages , including JSTL and JSF , as able-bodied as Acceleration Templates , XSLT , and additional presentation systems.
The framework s Ambassador acts as a arch amid the applications Archetypal and the web View. If a appeal is received, the Ambassador invokes an Activity class. The Activity chic consults with the Archetypal (or, preferably, a Bluff apery your Model) to appraise or amend the applications state. The framework provides an ActionForm chic to advice alteration data amid Archetypal and View.
Most often, the Archetypal is represented as a set of JavaBeans . Typically, developers will use the Aliment BeanUtils to alteration data amid ActionForms and the Archetypal altar (or a Facade). Preferably, the Archetypal will do the abundant lifting, and the Activity will act as a cartage cop or adapter.
Struts Config in a Nutshell
A web appliance uses a deployment descriptor to initialize assets like servlets and taglibs . The deployment descriptor is formatted as a XML certificate and called web.xml. Likewise, the framework uses a agreement book to initialize its own resources. These assets cover ActionForms to aggregate ascribe from users, ActionMappings to absolute ascribe to server-side Accomplishments , and ActionForwards to baddest achievement pages.
Heres a simple agreement (struts-config.xml) for a login workflow:
-//Apache Software Foundation//DTD Struts Agreement 1.3//EN
http://struts.apache.org/dtds/struts-config_1_3.dtd>
name=logonForm
type=app.LogonForm/>
path=/Welcome
forward=/pages/Welcome.jsp/>
path=/Logon
forward=/pages/Logon.jsp/>
path=/LogonSubmit
type=app.LogonAction
name=logonForm
scope=request
validate=true
input=/pages/Logon.jsp>
name=success
path=/pages/Welcome.jsp/>
name=failure
path=/pages/Logon.jsp/>
path=/Logoff
type=app.LogoffAction>
name=success
path=/pages/Logoff.jsp/>
There are several additional assets you can specify in the frameworks agreement file. You can specify validations for the ActionForms in an XML descriptor, using the Struts Validator . A accepted extension, Tiles , helps you body pages from abate fragments.
Struts Activity framework is extensible. Every chic deployed by the framework can be replaced by your own absence class. The backdrop of your absence chic can be set using the Digesters set-property feature. This is one cause why there are so some contributor extensions
tiles is a contributor extension
s Features
Screen definitions
Create a awning by accumulating Tiles : header, footer, menu, body, etc.
Definitions can yield abode :
in a centralized xml book
directly in jsp pages
programatically in struts accomplishments
Definitions accommodate an bequest apparatus : a analogue can extend addition one, and override parameters.
Layouts
Define accepted page layouts and reclaim them beyond your web site.
Define card layouts, and use them by casual lists of items and links.
Define a aperture layout, use it by casual a account of Tiles (pages) to show.
Reuse absolute layouts, or ascertain your own.
Dynamic page architecture
Tiles can be aggregate dynamically during page reload. It is accessible to change any attribute: layout, account of Tiles in portal, account of card items, etc.
Reuse of Tiles / Apparatus
If able-bodied defined, a Asphalt can be reused beyond assorted applications.
Dynamic attributes are acclimated to parameterize Tiles.
It is accessible to ascertain a library of reusable Tiles.
Build a page by accumulating predefined components, giving them adapted parameters.
Internationalization (i18n)
It is accessible to amount altered tiles according to Locale.
A apparatus agnate to Java backdrop files is acclimated for definitions files: you can accept one analogue book per Locale. The adapted analogue is loaded according to the accepted Locale.
Multi-channels
It is accessible to amount altered Tiles according to a key.
For example, the key could be user provilege, browser type, approximate name stored in session, etc.
A apparatus agnate to Java backdrop files is acclimated for definitions files: you can accept one analogue book per key. The adapted analogue is loaded according to the key.
Apart from basal compassionate of architecture a web application. The clairvoyant is appropriate to accept some array of alive knowlege in the afterward technologies.
Struts framework provides the afterward allowances over accepted methods of Web Appliance Development.
These allowances are acquired because Struts provides a arrangement based on the Archetypal 2 archetype of Java web appliance design, while aswell accouterment a framework for the appliance that is cleaner than a alternation of J2EE servlets.
Best practices : http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts.html
Example applications : http://sourceforge.net/projects/struts
Documentation : http://struts.apache.org/userGuide/index.html
|
Tags: action, appropriate, based, development, pages, files, different, application, class, applications, provides, according, programming, technologies, model, resources, layouts, framework, properties struts, framework, model, tiles, class, applications, definition, define, definitions, pages, application, action, according, apache, reference, layouts, development, resources, files, provides, controller, reuse, appropriate, locale, properties, descriptor, actionforms, configuration, based, technologies, mechanism, , web application, model and, framework provides, apache org, java properties files, one definition file, different tiles according, load different tiles, http struts apache, transfer data between, java programming struts, |
Also see ...
PermalinkArticle In : Computers & Technology - Programming