How To Add A Legacy JSP Page Or Struts Action Class

  1. This instructions for a jsp page that belongs to the Admin tab. For example, the Add/Edit Lookup Option page. Start by downloading the source code that goes with this tutorial Obtain the basepage.jsp which has all the common features shared by all the pages under Admin tab. The base page will contain all the common layout up to the blue line under the main tabs.
  2. Replace the labels and form action with the ones defined in the configuration property file for your page.
  3. Open your mockup page in your favorite jsp page editor. Select the whole part right under the blue strip which is right under the main tabs.
  4. Select and copy that part then do New -> html file. Paste it into the page.
  5. Switch to view Source and copy the part in between the body of the page.
  6. Paste this part into your base page, right under this part
  7. Replace the html tags with your tags. Replace texts with mifoslabel and the names of the mifoslabel are defined in the configuration property file.
  8. Create an Action and ActionForm associated with the jsp page using the files YourAction.java and CollectionSheet.java. Replace Your... with your actual file names and paths.
  9. Add the security for your page in the method getSecurity();
  10. Import YourAction to the file ActivityMapper (in the folder framework/security/util) and in this class constructor add the line parseActionSecurity(YourAction.getSecurity())
  11. Add the action and action form mapping in *struts-config.xml, or
    <form-bean name="youractionform" type="org.mifos.application.......struts.actionform.CollectionSheet"></form-bean>
    

Add action path for the form in the same file.

<action path="/yourAction" type="org.mifos.application........struts.action.YourAction"
  name="youractionform" parameter="method" input="/yourAction.do?method=validate"
  validate="true" scope="session">
<forward name="load_success" path="... " />
<forward name="load_success" path="... " />
<forward name="load_success" path="... " />
</action>``

  1. Add validation rules to validation.xml (META-INF folder)
  2. If define new resource file add this line to *-struts-config.xml
    <!--  Your Story resources -->
    <message-resources key="yourStoryUIResources" parameter="org.mifos.application.....util.resources.YourUIResources"
    </message-resources>
    

Note that if the key is yourStoryUIResources then you have to define the same in your resource file. For example, yourStoryUIResources.define=Define

From meonkeys Mon Jun 9 19:03:42 -0700 2008 From: meonkeys Date: Mon, 09 Jun 2008 19:03:42 -0700 Subject: database work Message-ID: <20080609190342-0700@mifos.org>

A database upgrade may also be necessary (if a new action is required).