Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-1947

how to align field maxlenths with JDBC source

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0
    • Fix Version/s: Future
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other
    • Bugzilla Id:
      26411

      Description

      in http://www.manning-source.com/books/husted/husted_ch12.pdf on p370, Ted
      rightfully says that one disadvantage of using the valiator.xml is that there is
      now yet another file that needs to be kept synchronized.
      With http://sourceforge.net/projects/fmpp and asm-dumpfield as per
      http://sourceforge.net/mailarchive/message.php?msg_id=6152001, I was able to
      automate this all in a single place (i.e. page markup, the ActionForm, and the
      Validator and Struts configuration).

      The alignment of SQL field names AND lengths is yet a similar problem.
      Were mysqldump working as specified (http://bugs.mysql.com/bug.php?id=1530), my
      fmpp could do that too and generate a SQLConst.java file that would prevent my
      sql queries suffering from time-consuming field name typos, etc.

      Similarly, such sql-schema output could also be used to extract maximum field
      lengths and data types for validation.xml. (especially since for example MySQL
      is very much in need for maxlength validation - http://lists.mysql.com/java/6889)

      Suggestions:
      1) as per Ted's chapter, it would be useful to have a "Pro&Con" or "When to best
      use the validator" section in dev_validator.html
      2) add a ToDo section to the chapter listing the need for a mechanism to easily
      align maxlength of SQL and the struts validator (see also
      http://bugs.mysql.com/bug.php?id=1307) - or do you already have a solution for that?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hauser@acm.org Ralf Hauser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: