Updating a screen in a running application with the web UI framework

You can update a screen in a running application by running the application in Struts dev mode in exploded war mode.

About this task

After updating the code of a screen component using a code template, you can update that component in a running application without stopping the server (hot code replace).

In the update window, you can paste in code or type in your own code.

You can use this procedure when you are adding new code or updating existing code. To override existing code, the new code must have the same resource ID as the existing code.

Hot code replace and code generation are completely independent of each other. Hot code replace enables you to view your changes in the application without having to update any files or restart the server. This reduces the total development time and also enables you to debug or test your changes to the application.

Procedure

  1. Make sure that you are running the application in Struts dev mode in exploded war mode (provide -Ddevmode=true while building the war file). Also, when launching the application, wufdevmode should be set to true.
  2. Access the hot code replace screen using the following JSP:

    /platform/dev/afc_updatePage.jsp (In case of Sterling Application Platform)

    The Hot Code Update page for applications that consume the uifwk clump only would be at the following relative path:

    /platform/dev/uifwk_updatePage.jsp

    To enable hot code replace for any other component, applications need to provide their own dev JSP and its implementation.

  3. Click on the tab for the component that you want to update (Mashup, JSB, Resource, Resource Permission, Menu).
  4. Paste in the code that you generated for that component in the Code Template Generator. You can also paste in code that you have hand-coded or directly type in code.
  5. Update the application by doing one of the following:
    • To update one component, click the tab for that component and click the Update button.
    • To update more than one changed component (but not all changed components), click the tab for each component and click the Update button.

    Updating a resource, resource permission, or menu updates these components both temporarily in the current login session and permanently in the database. Updates to a mashup or JSB are made only in the current login session.

    When you press the Update button, the changes are written to the URL of the application, where you can test the changes.