Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Build Struts applications easily
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Build Struts applications easily


Jim Mason, Search400.com expert
07.10.2003
Rating: -2.60- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You might ask, "Why do I need to know about Struts. Why are they important to Web applications?" Simply put, the Struts framework provides a common architecture and a set of services for developing the key elements of Java Web applications. Advantages to using Struts in Web applications:

* They promote the reuse of application logic
* They separate presentation, logic and control
* They make modular applications more maintainable
* Struts actions are configurable at runtime

WebSphere Development Studio Client (WDSC) provides a variety of tools, wizards and editors to make it easier and more productive to build Struts applications, especially for developers new to Struts. Lets take a look at those tools and their functionality.


[TABLE]

Struts tools included in WDSC version 5

WDSC also provides strong support for building, testing and packaging all the other elements of your Struts web application as well: HTML pages, resources (image files), Java beans, etc.

Web project wizard
The Web project wizard supports adding the Struts resources required for a Struts version 1.02 or 1.1 application: jar files and JSP tag library descriptor files in the appropriate location. As an alternative, Apache supplies a blank.war file for Struts that contains the Struts resources already set up in the proper application structure as the starting point for defining your Struts application project.

ActionForm wizard
The ActionForm wizard builds a subclass of ActionForm. It allows you to select form elements from any Struts JSP to consolidate in the ActionForm.

Action class wizard
This is really the standard class wizard to create a new class. By default, it is set to create a subclass of ActionForm. This has little impact on development.

Struts configuration file wizard and editor<


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Web Tools
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i
System i PHP authoring tool tries to fill void in Web-coding know-how
Lazy coder: What does PHP on the i5 mean?

Web Development
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale
Application modernization strategies for System i
RPG application modernization for i5
Web skills crucial to iSeries programmer professional development

Web Servers
System i no longer the stepchild of IBM's world
Connecting WebSphere to AS/400 for image retrieval
Weaving in WebSphere
SOA enhancements drive IBM WebSphere feature packs
SOA means money for IT workers
Enable J2EE app on WAS to access DB2
Securing Apache: Keeping patches current
IBM runs USOpen.org on Power boxes
MoMA's IT makeover a mix of old and new
How does RPG talk to a browser?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


/b>
This special wizard and editor creates and maintains a Struts configuration file. Especially for new developers, it improves productivity and quality building a Struts configuration. You can access the straight XML source if you are more familiar with Struts configurations. If you're new to Struts, the separate pages defining Action mappings, Global forwards, Form beans and Data Sources will make it easier to create and edit these Struts definitions accurately. However, you still need to understand what these Struts elements are.

The Struts configuration editor makes it easy to view the Actions, Form beans and Global Forwards that make up the workflow in our Registration application.

ActionMapping editor
The ActionMapping editor lets you create and edit an ActionMapping in a Struts configuration file. New developers will find it easier than trying to correctly enter the mappings directly as XML elements. Specific attributes such as ActionForms and JSPs are easy to find and select using Browse buttons and drop-down list boxes.

Struts JSP wizard
This is the standard JSP wizard to create a new JSP that now supports adding Struts tag library directives, references to the ActionForm bean and Action classes.

Page Designer JSP editor with Struts tag support
Page Designer allows you to insert and edit custom Struts JSP tags reasonably productively. URLs are easy to set on Struts hyperlinks and form actions, and Page Designer can dynamically link to messages in the ApplicationResources.properties file.

You'll find that the design and source views work well with Struts tags. The preview mode doesn't support access to dynamic resources such as the messages in the ApplicationResources properties, so you won't find it useful to view what your JSPs will look like at runtime.

There were some issues referencing resources in modules other the default module in URLs in Page Designer in WDSC version 5.0. This problem MAY be addressed in service pack 5.01, but we didn't test that.

Struts module wizard and editor
This wizard allows you to create and edit module definitions for a Struts application (a Struts 1.1 feature that makes Struts applications scale well).

Web diagram tool for maintaining visually a Struts application workflow
The web diagram editor provides a visual layout tool to define Struts application objects and their relationships. The same information is available in your Struts configuration file and can be accessed by the Struts configuration file editor.

We built our Registration Struts application easily without using the Web diagram editor. Later we went back and built it again using the diagram editor. Did it make any significant difference? Not really.

Where might the Web diagram editor pay off? If you're a new Struts developer and prefer visual layout tools that show connections as arrows, you'll like using the Web diagram editor over the Struts configuration file editor. More experienced developers may prefer the Struts configuration file editor.

Both tools share some similarity: They both update a Struts configuration file and both can work with subsets of the Struts application configuration (making it easier for developers to work on larger applications). You can also define Struts components in both tools BEFORE they are created. If they exist, configurations are easier because they can be selected via a Browse button to add to the configuration. The diagram editor will change colors to reflect whether a defined Struts component exists which can make it easier to know which elements still have to be created.

WebSphere test environment for testing your Struts application
The WebSphere test environment does not have any special Struts features, BUT it is a key tool for easily testing, debugging and profiling your Struts applications. We found it possible to trace, log and profile Struts applications running in remote WebSphere or Tomcat servers; however, the WebSphere test environment was the easiest to debug.

Deployment to runtime environments: Apache Tomcat 4.1.24, WebSphere v 5.0 and WebSphere Express v 5.0 was easy. If possible, avoid using earlier versions of the Web application servers with Struts 1.1 applications. You may have to set custom classpaths.

Learning more about Struts

---------------------------------------

About the author: Jim Mason, president of ebt-now, is an iSeries WebSphere engineer. ebt-now provides iSeries WebSphere, WebFacing project management, engineering, development and training services.

==================================
MORE INFORMATION
==================================


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts