Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3049

Error "StrutsUtils is not defined" in validation.js, using validation annotation method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.6
    • None
    • None
    • None
    • Windows XP SP2, Eclipse Ganymede SR2, Maven 2.0.10

    Description

      I'm getting the error "StrutsUtils is not defined" when my form is displayed (See attached screenshot).
      The validation is done using annotations.

      Here is the action code:
      @Validation()
      public class ExportAction extends ActionSupport {
      @SkipValidation
      public String prepare() throws Exception

      { // This method is called before the display of the form // Forward to the form tiles return INPUT; }

      @Validations(
      requiredFields =

      {@RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName = "email", message = "Vous devez saisir votre adresse e-mail.")}

      ,
      emails =

      {@EmailValidator(type = ValidatorType.SIMPLE, fieldName = "email", message = "Vous devez saisir une adresse e-mail valide.")}

      )
      public String launch() throws Exception

      { // This method is called on the submit button activation return SUCCESS; }

      }

      Here is the JSP code of my form:
      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      <%@ taglib prefix="s" uri="/struts-tags" %>
      <s:form action="Export_launch" method="get" validate="true">
      <s:hidden name="fullExport"/>
      <s:hidden name="lastExportRunDateISOStr"/>
      <div class="txt_standard">
      <s:textfield label="Votre adresse e-mail" labelSeparator=":" name="email" tabindex="0" size="40" labelposition="left" />
      <h3>Un rapport vous sera transmis en fin de traitement à cette adresse.</h3>
      </div>
      <div class="txt_standard">
      <h2>Export complet des Individus</h2>
      <h3>Traitement long qui exporte la totalité des individus avec toutes leurs coordonnées.</h3>
      <s:submit value="Export global" onclick="this.form.fullExport.value='true';"/>
      </div>
      <div class="txt_standard">
      <h2>Export partiel des Individus</h2>
      <h3>Traitement court qui exporte uniquement les individus modifié depuis le dernier export en date du <s:date name="lastExportRunDate" format="dd/MM/yyyy HH:mm"/></h3>
      <s:submit value="Export partiel" onclick="this.form.fullExport.value='false';"/>
      </div>
      <div class="txt_standard">
      <h2>Dernier fichier exporté le <s:date name="lastExportRunDate" format="dd/MM/yyyy HH:mm"/></h2>
      </div>
      <div class="txt_standard">
      <img src="images/general/icon_square1.gif" alt="square" class="img_square">
      <s:set var="urlExport"><s:property value="exportWebPath"/>/<s:property value="lastExportFilename"/></s:set>
      <a href="<s:property value="urlExport" />" class="lnk_square"><s:property value="lastExportFilename"/></a>
      </div>
      </s:form>

      Attachments

        1. ScreenShot_20090319_135236.png
          129 kB
          Joël Royer

        Activity

          People

            Unassigned Unassigned
            jroyer Joël Royer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: