IT.CappuccinoNet.com

StrutsCX Intro

Overview

Installation

Publications

History

FAQ

Samples

Resources

Licencing

Mailinglist

Downloads

SourceForge Logo

Gmane


StrutsCX - Sample Applications StrutsCX
You can get all the sample applications described here at SourceForge.

Thanks to Matt Raible you can view the application online.

strutscx-demo.war

This sample application shows a compelte CRUDcyle ( Create, Retrieve, Update, Delete) in the languages English, German and Korean. It uses the XML data binding framework Castor XML in the backend to persist the data you enter in simple XML files. Feel free to replace it with your favorite data storage solution.

For client side validation this application uses the Struts Validator.

In addition the handling of data out of almost every HTML form type is demonstrated (no file upload). The XSL Stylesheets include external files with the layout and variables.

The introducing screen showing the screenflow of the sample application

Die StrutsCX Demo Application with the list of all datasets

The input screen in English language showing an error message

The input screen in Korean language showing an error message

The untransformed XML-Output-Document the StrutsCXServlet auto-generated shown in the browser





This is what we've done to create some sample applications on top of the strutscx-demo.war. Just rough notes, this is all optional, but maybe helpful for you to get quickly ready with StrutsCX for your application development:

strutscx-pdf.war

The same content as above transformed into PDF. Just provide an appropriate XSL-FO stylesheet

  • Because we just show data from the datasource we do need the IntroAction (for the intro page) and the RetrieveAllAction (for the list with all the datasets)
  • There is no ActionForm necessary because we do not update data
  • The classes in the business, integration, util and vo packages stay untached
  • We just need two stylesheets: the info_intro.xsl for the entry page and the info_retrieveall.xsl with the XSL-FO code
  • make sure to add the following JARs to the WEB-INF/lib folder:
    avalon-xxx.jar, batik.jar, fop-xxx.jar
  • adjust the package names and references to it sample01 -> sample02
  • make sure a userconfig.xml is in the WEB-INF folder
  • make sure the font and font-metrics folders are in the WEB-INF folder
  • configure the struts-config.xml:
    - make sure there is an action element like this:
    <action path="/infolist"
     type="com.cappuccinonet.strutscx.sample02.
     presentation.action.InfoRetrieveAllAction">
    <forward name="success" path="/StrutsCXServlet"/>
    </action>
    no need for a FormBean definition
    - edit the project's name
    properties-->param-->project
    - make sure there is a pointer to our xsl file
    <!-- info output type: fop/foppdf -->
    <definition name="info.pdf.retrieveall">
     <put>/WEB-INF/xsl/info_retrieveall.xsl</put>
    </definition>
  • Inside the Action classes: Update the pointers to the XSL stylesheets
  • update the
    <meta http-equiv="Refresh"
        content="0; URL=/strutscx-pdf/info.do">
    of the index.html; this is the first file Tomcat calls
  • update the strutscx-log4j-config.xml for your system
  • Add an appropriate XSL Stylesheet with XSL-FO elements
  • web.xml:
    Change the application's name
  • update the projectname variables in the inc_variables.xsl
  • InfoDelegate: Update path to Factory
  • Because there are no forms we do not need the Struts Validator configuration files: validation.xml, validator-rules_xx.dtd, validator-rules.xml

Up 

strutscx-piped.war

  • Because we just show data from the datasource we do need the IntroAction (for the intro page) and the RetrieveAllAction (for the list with all the datasets)
  • There is no ActionForm necessary because we do not update data
  • The classes in the business, integration, util and vo packages stay untached
  • We just need three stylesheets: the info_intro.xsl for the entry page, the info_retrievesingle.xsl for a single dataset and a series of 3 info_retrieveall.xsl we will put in a pipeline with the list
  • adjust the package names and references to it sample01 -> sample02
  • strutscx-log4j-config: set the names of the output files according your system
  • update the
    <meta http-equiv="Refresh"
        content="0; URL=/strutscx-pdf/info.do">
    of the index.html
  • struts-config.xml - make sure there is an Action element
    <action path="/infolist"
     type="com.cappuccinonet.strutscx.sample03.
     presentation.action.InfoRetrieveAllAction">
    <forward name="success" path="/StrutsCXServlet"/>
    </action>
    <action path="/infosingle"
      type="com.cappuccinonet.strutscx.sample03.
      presentation.action.InfoRetrieveSingleAction">
     <forward name="success" path="/StrutsCXServlet"/>
    </action>
    no need for a FormBean definition
    - edit the project's name
    properties-->param-->project
    - set FOP to OFF
    - make sure there is are pointers to our xsl files; note that we do have a series of three XSL stylesheets under one definition
    <definition name="info.piped.retrieveall">
     <put>/WEB-INF/xsl/multiple/
      info_retrieveall_01.xsl</put>
     <put>/WEB-INF/xsl/multiple/
      info_retrieveall_02.xsl</put>
     <put>/WEB-INF/xsl/multiple/
      info_retrieveall_03.xsl</put>
    </definition>
    <definition name="info.piped.retrievesingle">
     <put>/WEB-INF/xsl/multiple/
      info_retrievesingle.xsl</put>
    </definition>
  • Inside the Action classes:
    Update the pointers to the XSL stylesheets
  • Edit and add the XSL Stylesheets
  • web.xml:
    - Change the application's name
  • update the projectname variables in the inc_variables.xsl
  • InfoDelegate: Update path to Factory
  • Because there are no forms we do not need the Struts Validator configuration files: validation.xml, validator-rules_xx.dtd, validator-rules.xml

Up 

strutscx-clientside.war

  • Because we just show data from the datasource we do need the IntroAction (for the intro page) and the RetrieveAllAction (for the list with all the datasets)
  • There is no ActionForm necessary because we do not update data
  • The classes in the business, integration, util and vo packages stay untached
  • We just need three stylesheets: the info_intro.xsl for the entry page, the info_retrievesingle.xsl for a single dataset and a series of 3 info_retrieveall.xsl we will put in a pipeline with the list
  • adjust the package names and references to it sample01 -> sample02
  • strutscx-log4j-config: set the names of the output files according your system
  • update the
    <meta http-equiv="Refresh"
        content="0; URL=/strutscx-pdf/info.do">
    of the index.html
  • struts-config.xml -make sure there is an Action element
    <action path="/infolist"
     type="com.cappuccinonet.strutscx.sample04.
     presentation.action.InfoRetrieveAllAction">
    <forward name="success" path="/StrutsCXServlet"/>
    </action>
    <action path="/infosingle"
      type="com.cappuccinonet.strutscx.sample04.
      presentation.action.InfoRetrieveSingleAction">
     <forward name="success" path="/StrutsCXServlet"/>
    </action>
    no need for a FormBean definition
    strutscx-config.xml:
    - editi the project's name
    properties-->param-->project
    - set FOP to OFF
    - make sure there is are pointers to our xsl files; note that these stylesheets must be reachable for the client, so put them above the WEB-INF folder!
    <!-- info output type: xsl_clientside -->
    <definition name="info.xsl.retrieveall">
     <put>/clientside_xsl/info_retrieveall.xsl</put>
    </definition>
    <definition name="info.xsl.retrievesingle">
     <put>/clientside_xsl/info_retrievesingle.xsl</put>
    </definition>
  • Inside the Action classes:
    Update the pointers to the XSL stylesheets
  • Edit and add the XSL Stylesheets and put them above the WEB-INF folder
  • web.xml
    - Change the application's name
  • update the projectname variables in the inc_variables.xsl
  • InfoDelegate: Update path to Factory
  • Because there are no forms we do not need the Struts Validator configuration files: validation.xml, validator-rules_xx.dtd, validator-rules.xml

Up 





Imprint/Impressum

IT.CappuccinoNet.com IT.CappuccinoNet.conm
© IT.CappuccinoNet.com, 2000-2010
| Last modified 02.18.2009