Essential ATG Dynamo Training - Got atg Certified Relationship Management Developer?
This is not an official ATG site: ATG, Dynamo, Scenario Server and Personalization Server are trademarks or registered trademarks of Art Technology Group
Articles Exercises Resources Links Search

Summary for converting JHTML to JSP

Review Part 1 and Part 2 for details

  1. Create a J2EE Application
  2. If your new JSP pages will use components which are not part of the standard ATG install these components will need to be loaded in order to get your JSP pages working. This can be solved in 2 ways:
    1. Add the components to the j2ee application's config layer
    2. Keep the components in a separate Dynamo module and add that module to the dependency list of your j2ee application's META-INF/MANIFEST.MF file, thus (where 'Dating' is the module we want to load) :
      Manifest-Version: 1.0
      ATG-Config-Path: config/
      ATG-Required: Dating
  3. For each JHMTL page, create a new empty jsp page, then add the dspTaglib import for the dsp jsp tag library and then add a pair of dsp:page tags with a few lines between them, if your page is not a fragment just use the provided JSP page template in the ACC
    <%@ taglib uri="/dspTaglib" prefix="dsp"%>
    <dsp:page>
    
    
           <!-- content will go here -->
    
    
    </dsp:page>
  4. Paste the original JHTML into the middle of the dsp:page tags
  5. Rename all the .jhtml links to point to the new .jsp files
  6. Comment out the declareparam tags
  7. Prefix all other JHTML tags with dsp:
  8. Replace all UPPERCASE attribute names with lowercase, since the JSP tag attribute names are case sensitive e.g. VALUE= will not work, whereas value= works correctly
  9. Ensure that dsp:input, dps:option and dsp:param tags are terminated with /> (content-less tags)
  10. Ensure all the attributes in the page are quoted e.g:
       method=post should be method="post"
  11. Ensure that multiple select boxes define the multiple attribute as follows:
    multiple="<%=true%>" 
  12. Replace all param:xxx tags with <%= request.getParameter('xxx') %>
  13. Replace all droplet src= type includes with dsp:include
  14. Replace value="bean:xxx" sequences with bean="xxxx"
  15. Replace all remaining bean: tags with Java to extract the values from scripting variables; either using the dsp:getvalueof tag or replacing them with bean='xxx' (for Switch)
  16. Try to preview the page and replace all renamed attributes with the ones specified in the error messages

Remember: User Appendix D of the page developers guide as a reference and look into the jsp page templates that the ACC provides. 

In tricky situations you'll need the dsp:getvalueof tag. This important tag allows you to extract a param, a bean or a bean property and store it in a java variable in the page script. See the docs in Appendix D for more information

To help speed things up I wrote these UltraEdit macros, they DO NOT FINISH THE JOB!! They just do some of the legwork so then I can go in an fix all the errors, not limited to:

  • closing off the dsp:input, dsp:option, dsp:importbean and dsp:param tags with />
  • Doing any inline java like for param: going to request.getParameter....
  • Adding any dsp:getvalueof tags that are needed

NOTE: OF COURSE YOU FOOLISHLY USE THESE MACROS AT YOUR OWN RISK!!! - DON'T BLAME ME IF THEY DELETE ALL YOUR WORK

If something is not working don't forget to view the HTML source in the browser, you may see unprocessed tags like param: or valueof in the HTML, this is THE BEST WAY to find problems. Also remember to check the ATG Dynamo error log, people often forget that!

Good luck 

The JHTML Dating module is here the DatingJSP module is here, the DatingJSP module depends on the Dating module for repositories, targeters and other components.

You'll need to configure the database tables yourself, look up startSQLRepository in the Dynamo docs for tips on how to do that base on the supplied repository configuration files

 

 


Technical Training Advertise your Training Programs for Free! Los Angeles Web Design Shopping Cart Software  Form a Corporation